Show NewServerModal when no servers exist in SettingsPage
This commit is contained in:
@@ -34,6 +34,9 @@ const SettingsPage = React.createClass({
|
|||||||
initialState.showAddTeamForm = false;
|
initialState.showAddTeamForm = false;
|
||||||
initialState.trayWasVisible = remote.getCurrentWindow().trayWasVisible;
|
initialState.trayWasVisible = remote.getCurrentWindow().trayWasVisible;
|
||||||
initialState.disableClose = initialState.teams.length === 0;
|
initialState.disableClose = initialState.teams.length === 0;
|
||||||
|
if (initialState.teams.length === 0) {
|
||||||
|
initialState.showAddTeamForm = true;
|
||||||
|
}
|
||||||
|
|
||||||
return initialState;
|
return initialState;
|
||||||
},
|
},
|
||||||
@@ -57,6 +60,9 @@ const SettingsPage = React.createClass({
|
|||||||
showAddTeamForm: false,
|
showAddTeamForm: false,
|
||||||
teams
|
teams
|
||||||
});
|
});
|
||||||
|
if (teams.length === 0) {
|
||||||
|
this.setState({showAddTeamForm: true});
|
||||||
|
}
|
||||||
},
|
},
|
||||||
handleSave() {
|
handleSave() {
|
||||||
var config = {
|
var config = {
|
||||||
|
@@ -68,7 +68,8 @@ describe('application', function desc() {
|
|||||||
return this.app.start().then(() => {
|
return this.app.start().then(() => {
|
||||||
return this.app.client.
|
return this.app.client.
|
||||||
waitUntilWindowLoaded().
|
waitUntilWindowLoaded().
|
||||||
getUrl().should.eventually.match(/\/settings.html$/);
|
getUrl().should.eventually.match(/\/settings.html$/).
|
||||||
|
isExisting('#newServerModal').should.eventually.equal(true);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@@ -49,6 +49,22 @@ describe('browser/settings.html', function desc() {
|
|||||||
getUrl().should.eventually.match(/\/index.html$/);
|
getUrl().should.eventually.match(/\/index.html$/);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('should show NewServerModal after all servers are removed', () => {
|
||||||
|
const modalTitleSelector = '.modal-title=Remove Server';
|
||||||
|
env.addClientCommands(this.app.client);
|
||||||
|
return this.app.client.
|
||||||
|
loadSettingsPage().
|
||||||
|
click('=Remove').
|
||||||
|
waitForVisible(modalTitleSelector).
|
||||||
|
element('.modal-dialog').click('.btn=Remove').
|
||||||
|
pause(500).
|
||||||
|
click('=Remove').
|
||||||
|
waitForVisible(modalTitleSelector).
|
||||||
|
element('.modal-dialog').click('.btn=Remove').
|
||||||
|
pause(500).
|
||||||
|
isExisting('#newServerModal').should.eventually.equal(true);
|
||||||
|
});
|
||||||
|
|
||||||
describe('Options', () => {
|
describe('Options', () => {
|
||||||
describe('Hide Menu Bar', () => {
|
describe('Hide Menu Bar', () => {
|
||||||
it('should appear on win32 or linux', () => {
|
it('should appear on win32 or linux', () => {
|
||||||
|
Reference in New Issue
Block a user