Fix tests which use AutoSaveIndicator

This commit is contained in:
Yuya Ochiai
2018-02-03 00:00:31 +09:00
parent 88e6dd9de0
commit 92f56ce2d3
2 changed files with 12 additions and 6 deletions

View File

@@ -342,6 +342,7 @@ const SettingsPage = createReactClass({
<h2 style={settingsPage.sectionHeading}>{'Server Management'}</h2>
<div className='IndicatorContainer'>
<AutoSaveIndicator
id='serversSaveIndicator'
savingState={this.state.savingState.servers}
errorMessage={'Can\'t save your changes. Please try again.'}
/>
@@ -554,6 +555,7 @@ const SettingsPage = createReactClass({
<h2 style={settingsPage.sectionHeading}>{'App Options'}</h2>
<div className='IndicatorContainer'>
<AutoSaveIndicator
id='appOptionsSaveIndicator'
savingState={this.state.savingState.appOptions}
errorMessage={'Can\'t save your changes. Please try again.'}
/>

View File

@@ -62,7 +62,8 @@ describe('browser/settings.html', function desc() {
setValue('#teamUrlInput', 'http://example.org').
click('#saveNewServerModal').
waitForVisible('#newServerModal', true).
waitForVisible('.AutoSaveIndicator', 10000, true). // at least 2500 ms to disappear
waitForVisible('#serversSaveIndicator').
waitForVisible('#serversSaveIndicator', 10000, true). // at least 2500 ms to disappear
isEnabled('#btnClose').then((enabled) => {
enabled.should.equal(true);
});
@@ -465,15 +466,18 @@ describe('browser/settings.html', function desc() {
it('should add the team to the config file', (done) => {
this.app.client.
click('#saveNewServerModal').
pause(1000). // Animation
click('#btnClose').
pause(1000).then(() => {
waitForVisible('#newServerModal', true).
waitForVisible('#serversSaveIndicator').
waitForVisible('#serversSaveIndicator', 10000, true). // at least 2500 ms to disappear
waitUntilWindowLoaded().then(() => {
const savedConfig = JSON.parse(fs.readFileSync(env.configFilePath, 'utf8'));
savedConfig.teams.should.contain({
savedConfig.teams.should.deep.contain({
name: 'TestTeam',
url: 'http://example.org'
});
return done();
done();
}).catch((err) => {
done(err);
});
});
});