Merge pull request #555 from yuya-oc/fix-x-on-first-launch
Fix close button not working when the number of servers is not zero
This commit is contained in:
commit
56ec6dedcf
|
@ -23,6 +23,8 @@ Release date: TBD
|
||||||
#### All Platforms
|
#### All Platforms
|
||||||
- Fixed mis-aligned `+` button of tab bar.
|
- Fixed mis-aligned `+` button of tab bar.
|
||||||
[#541](https://github.com/mattermost/desktop/issues/541)
|
[#541](https://github.com/mattermost/desktop/issues/541)
|
||||||
|
- Fixed the close button of the Settings page not working on first installation.
|
||||||
|
[#552](https://github.com/mattermost/desktop/issues/552)
|
||||||
|
|
||||||
#### Windows
|
#### Windows
|
||||||
- Fixed desktop notifications not working when the window has been minimized from inactive state.
|
- Fixed desktop notifications not working when the window has been minimized from inactive state.
|
||||||
|
|
|
@ -39,7 +39,6 @@ const SettingsPage = createReactClass({
|
||||||
|
|
||||||
initialState.showAddTeamForm = false;
|
initialState.showAddTeamForm = false;
|
||||||
initialState.trayWasVisible = remote.getCurrentWindow().trayWasVisible;
|
initialState.trayWasVisible = remote.getCurrentWindow().trayWasVisible;
|
||||||
initialState.disableClose = initialState.teams.length === 0;
|
|
||||||
if (initialState.teams.length === 0) {
|
if (initialState.teams.length === 0) {
|
||||||
initialState.showAddTeamForm = true;
|
initialState.showAddTeamForm = true;
|
||||||
}
|
}
|
||||||
|
@ -454,7 +453,7 @@ const SettingsPage = createReactClass({
|
||||||
bsStyle='link'
|
bsStyle='link'
|
||||||
style={settingsPage.close}
|
style={settingsPage.close}
|
||||||
onClick={this.handleCancel}
|
onClick={this.handleCancel}
|
||||||
disabled={this.state.disableClose}
|
disabled={this.state.teams.length === 0}
|
||||||
>
|
>
|
||||||
<span>{'×'}</span>
|
<span>{'×'}</span>
|
||||||
</Button>
|
</Button>
|
||||||
|
|
|
@ -31,13 +31,41 @@ describe('browser/settings.html', function desc() {
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should show index.html when Close button is clicked', () => {
|
describe('Close button', () => {
|
||||||
env.addClientCommands(this.app.client);
|
it('should show index.html when it\'s clicked', () => {
|
||||||
return this.app.client.
|
env.addClientCommands(this.app.client);
|
||||||
loadSettingsPage().
|
return this.app.client.
|
||||||
click('#btnClose').
|
loadSettingsPage().
|
||||||
pause(1000).
|
click('#btnClose').
|
||||||
getUrl().then((url) => url.should.match(/\/index.html(\?.+)?$/));
|
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', () => {
|
it('should show NewServerModal after all servers are removed', () => {
|
||||||
|
|
Loading…
Reference in a new issue