Fix close button not working when the number of teams is not zero

This commit is contained in:
Yuya Ochiai
2017-07-01 21:58:30 +09:00
parent 77e5a7d88a
commit 1f86fbc18a
3 changed files with 38 additions and 9 deletions

View File

@@ -31,13 +31,41 @@ describe('browser/settings.html', function desc() {
return true;
});
it('should show index.html when Close button is clicked', () => {
env.addClientCommands(this.app.client);
return this.app.client.
loadSettingsPage().
click('#btnClose').
pause(1000).
getUrl().then((url) => url.should.match(/\/index.html(\?.+)?$/));
describe('Close button', () => {
it('should show index.html when it\'s clicked', () => {
env.addClientCommands(this.app.client);
return this.app.client.
loadSettingsPage().
click('#btnClose').
pause(1000).
getUrl().then((url) => url.should.match(/\/index.html(\?.+)?$/));
});
it('should be disabled when the number of servers is zero', () => {
return this.app.stop().then(() => {
env.cleanTestConfig();
return this.app.start();
}).then(() => {
return this.app.client.waitUntilWindowLoaded().
waitForVisible('#newServerModal').
click('#cancelNewServerModal').
isEnabled('#btnClose').then((enabled) => {
enabled.should.equal(false);
}).
waitForVisible('#newServerModal', true).
pause(250).
click('#addNewServer').
waitForVisible('#newServerModal').
setValue('#teamNameInput', 'TestTeam').
setValue('#teamUrlInput', 'http://example.org').
click('#saveNewServerModal').
waitForVisible('#newServerModal', true).
waitForVisible('.AutoSaveIndicator', true).
isEnabled('#btnClose').then((enabled) => {
enabled.should.equal(true);
});
});
});
});
it('should show NewServerModal after all servers are removed', () => {