Update settings specs to check for the webpreferences attribute

This commit is contained in:
Jonas Schwabe
2016-11-15 18:06:23 +01:00
parent d2b88920d0
commit b715637136

View File

@@ -92,7 +92,9 @@ describe('browser/settings.html', function desc() {
describe('Allow mixed content', () => { describe('Allow mixed content', () => {
[true, false].forEach((v) => { [true, false].forEach((v) => {
it(`should be saved and loaded: ${v}`, () => { it(`should be saved and loaded: ${v}`, () => {
const webPreferences = v ? 'allowDisplayingInsecureContent' : '';
env.addClientCommands(this.app.client); env.addClientCommands(this.app.client);
return this.app.client. return this.app.client.
loadSettingsPage(). loadSettingsPage().
scroll('#inputDisableWebSecurity'). scroll('#inputDisableWebSecurity').
@@ -107,19 +109,19 @@ describe('browser/settings.html', function desc() {
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);
}). }).
getAttribute('.mattermostView', 'disablewebsecurity').then((disablewebsecurity) => { // confirm actual behavior getAttribute('.mattermostView', 'webpreferences').then((disablewebsecurity) => { // confirm actual behavior
// disablewebsecurity is an array of String // disablewebsecurity is an array of String
disablewebsecurity.forEach((d) => { disablewebsecurity.forEach((d) => {
v.toString().should.equal(d); d.should.equal(webPreferences);
}); });
}).then(() => { }).then(() => {
return this.app.restart(); return this.app.restart();
}).then(() => { }).then(() => {
env.addClientCommands(this.app.client); env.addClientCommands(this.app.client);
return this.app.client. // confirm actual behavior return this.app.client. // confirm actual behavior
getAttribute('.mattermostView', 'disablewebsecurity').then((disablewebsecurity) => { // disablewebsecurity is an array of String getAttribute('.mattermostView', 'webpreferences').then((disablewebsecurity) => { // disablewebsecurity is an array of String
disablewebsecurity.forEach((d) => { disablewebsecurity.forEach((d) => {
v.toString().should.equal(d); d.should.equal(webPreferences);
}); });
}). }).
loadSettingsPage(). loadSettingsPage().