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
|
||||
- Fixed mis-aligned `+` button of tab bar.
|
||||
[#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
|
||||
- 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.trayWasVisible = remote.getCurrentWindow().trayWasVisible;
|
||||
initialState.disableClose = initialState.teams.length === 0;
|
||||
if (initialState.teams.length === 0) {
|
||||
initialState.showAddTeamForm = true;
|
||||
}
|
||||
|
@ -454,7 +453,7 @@ const SettingsPage = createReactClass({
|
|||
bsStyle='link'
|
||||
style={settingsPage.close}
|
||||
onClick={this.handleCancel}
|
||||
disabled={this.state.disableClose}
|
||||
disabled={this.state.teams.length === 0}
|
||||
>
|
||||
<span>{'×'}</span>
|
||||
</Button>
|
||||
|
|
|
@ -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', () => {
|
||||
|
|
Loading…
Reference in a new issue