Fix tests for auto-saving
This commit is contained in:
@@ -417,6 +417,7 @@ const SettingsPage = React.createClass({
|
|||||||
<div style={{position: 'relative'}}>
|
<div style={{position: 'relative'}}>
|
||||||
<h1 style={settingsPage.heading}>{'Settings'}</h1>
|
<h1 style={settingsPage.heading}>{'Settings'}</h1>
|
||||||
<Button
|
<Button
|
||||||
|
id='btnClose'
|
||||||
bsStyle='link'
|
bsStyle='link'
|
||||||
style={settingsPage.close}
|
style={settingsPage.close}
|
||||||
onClick={this.handleCancel}
|
onClick={this.handleCancel}
|
||||||
|
@@ -31,20 +31,11 @@ describe('browser/settings.html', function desc() {
|
|||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should show index.html when Cancel button is clicked', () => {
|
it('should show index.html when Close button is clicked', () => {
|
||||||
env.addClientCommands(this.app.client);
|
env.addClientCommands(this.app.client);
|
||||||
return this.app.client.
|
return this.app.client.
|
||||||
loadSettingsPage().
|
loadSettingsPage().
|
||||||
click('#btnCancel').
|
click('#btnClose').
|
||||||
pause(1000).
|
|
||||||
getUrl().should.eventually.match(/\/index.html(\?.+)?$/);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should show index.html when Save button is clicked', () => {
|
|
||||||
env.addClientCommands(this.app.client);
|
|
||||||
return this.app.client.
|
|
||||||
loadSettingsPage().
|
|
||||||
click('#btnSave').
|
|
||||||
pause(1000).
|
pause(1000).
|
||||||
getUrl().should.eventually.match(/\/index.html(\?.+)?$/);
|
getUrl().should.eventually.match(/\/index.html(\?.+)?$/);
|
||||||
});
|
});
|
||||||
@@ -109,7 +100,7 @@ describe('browser/settings.html', function desc() {
|
|||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}).
|
}).
|
||||||
click('#btnSave').
|
click('#btnClose').
|
||||||
pause(1000).then(() => {
|
pause(1000).then(() => {
|
||||||
const savedConfig = JSON.parse(fs.readFileSync(env.configFilePath, 'utf8'));
|
const savedConfig = JSON.parse(fs.readFileSync(env.configFilePath, 'utf8'));
|
||||||
savedConfig.hideMenuBar.should.equal(v);
|
savedConfig.hideMenuBar.should.equal(v);
|
||||||
@@ -142,7 +133,7 @@ describe('browser/settings.html', function desc() {
|
|||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}).
|
}).
|
||||||
click('#btnSave').
|
click('#btnClose').
|
||||||
pause(1000).then(() => {
|
pause(1000).then(() => {
|
||||||
const savedConfig = JSON.parse(fs.readFileSync(env.configFilePath, 'utf8'));
|
const savedConfig = JSON.parse(fs.readFileSync(env.configFilePath, 'utf8'));
|
||||||
savedConfig.disablewebsecurity.should.equal(!v);
|
savedConfig.disablewebsecurity.should.equal(!v);
|
||||||
@@ -248,7 +239,7 @@ describe('browser/settings.html', function desc() {
|
|||||||
element('.modal-dialog').click('.btn=Remove').
|
element('.modal-dialog').click('.btn=Remove').
|
||||||
pause(500).
|
pause(500).
|
||||||
isExisting(modalTitleSelector).should.eventually.false.
|
isExisting(modalTitleSelector).should.eventually.false.
|
||||||
click('#btnSave').
|
click('#btnClose').
|
||||||
pause(500).then(() => {
|
pause(500).then(() => {
|
||||||
const savedConfig = JSON.parse(fs.readFileSync(env.configFilePath, 'utf8'));
|
const savedConfig = JSON.parse(fs.readFileSync(env.configFilePath, 'utf8'));
|
||||||
savedConfig.teams.should.deep.equal(config.teams.slice(1));
|
savedConfig.teams.should.deep.equal(config.teams.slice(1));
|
||||||
@@ -261,7 +252,7 @@ describe('browser/settings.html', function desc() {
|
|||||||
element('.modal-dialog').click('.btn=Cancel').
|
element('.modal-dialog').click('.btn=Cancel').
|
||||||
pause(500).
|
pause(500).
|
||||||
isExisting(modalTitleSelector).should.eventually.false.
|
isExisting(modalTitleSelector).should.eventually.false.
|
||||||
click('#btnSave').
|
click('#btnClose').
|
||||||
pause(500).then(() => {
|
pause(500).then(() => {
|
||||||
const savedConfig = JSON.parse(fs.readFileSync(env.configFilePath, 'utf8'));
|
const savedConfig = JSON.parse(fs.readFileSync(env.configFilePath, 'utf8'));
|
||||||
savedConfig.teams.should.deep.equal(config.teams);
|
savedConfig.teams.should.deep.equal(config.teams);
|
||||||
@@ -374,7 +365,7 @@ describe('browser/settings.html', function desc() {
|
|||||||
this.app.client.
|
this.app.client.
|
||||||
click('#saveNewServerModal').
|
click('#saveNewServerModal').
|
||||||
pause(1000). // Animation
|
pause(1000). // Animation
|
||||||
click('#btnSave').
|
click('#btnClose').
|
||||||
pause(1000).then(() => {
|
pause(1000).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.contain({
|
||||||
|
Reference in New Issue
Block a user