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> <h2 style={settingsPage.sectionHeading}>{'Server Management'}</h2>
<div className='IndicatorContainer'> <div className='IndicatorContainer'>
<AutoSaveIndicator <AutoSaveIndicator
id='serversSaveIndicator'
savingState={this.state.savingState.servers} savingState={this.state.savingState.servers}
errorMessage={'Can\'t save your changes. Please try again.'} errorMessage={'Can\'t save your changes. Please try again.'}
/> />
@@ -554,6 +555,7 @@ const SettingsPage = createReactClass({
<h2 style={settingsPage.sectionHeading}>{'App Options'}</h2> <h2 style={settingsPage.sectionHeading}>{'App Options'}</h2>
<div className='IndicatorContainer'> <div className='IndicatorContainer'>
<AutoSaveIndicator <AutoSaveIndicator
id='appOptionsSaveIndicator'
savingState={this.state.savingState.appOptions} savingState={this.state.savingState.appOptions}
errorMessage={'Can\'t save your changes. Please try again.'} 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'). setValue('#teamUrlInput', 'http://example.org').
click('#saveNewServerModal'). click('#saveNewServerModal').
waitForVisible('#newServerModal', true). 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) => { isEnabled('#btnClose').then((enabled) => {
enabled.should.equal(true); enabled.should.equal(true);
}); });
@@ -465,15 +466,18 @@ describe('browser/settings.html', function desc() {
it('should add the team to the config file', (done) => { it('should add the team to the config file', (done) => {
this.app.client. this.app.client.
click('#saveNewServerModal'). click('#saveNewServerModal').
pause(1000). // Animation waitForVisible('#newServerModal', true).
click('#btnClose'). waitForVisible('#serversSaveIndicator').
pause(1000).then(() => { waitForVisible('#serversSaveIndicator', 10000, true). // at least 2500 ms to disappear
waitUntilWindowLoaded().then(() => {
const savedConfig = JSON.parse(fs.readFileSync(env.configFilePath, 'utf8')); const savedConfig = JSON.parse(fs.readFileSync(env.configFilePath, 'utf8'));
savedConfig.teams.should.contain({ savedConfig.teams.should.deep.contain({
name: 'TestTeam', name: 'TestTeam',
url: 'http://example.org' url: 'http://example.org'
}); });
return done(); done();
}).catch((err) => {
done(err);
}); });
}); });
}); });