2017-07-24 22:08:12 +02:00
|
|
|
const helpers = require("./global-setup");
|
|
|
|
const expect = require("chai").expect;
|
2017-02-05 11:38:01 +01:00
|
|
|
|
2017-07-24 22:08:12 +02:00
|
|
|
const describe = global.describe;
|
|
|
|
const it = global.it;
|
2017-02-05 11:38:01 +01:00
|
|
|
|
2017-07-24 22:08:12 +02:00
|
|
|
describe("Development console tests", function() {
|
2017-07-20 00:25:10 -04:00
|
|
|
// This tests fail and crash another tests
|
2017-07-24 22:08:12 +02:00
|
|
|
// Suspect problem with window focus
|
2017-07-20 00:25:10 -04:00
|
|
|
// FIXME
|
|
|
|
return false;
|
|
|
|
|
2017-07-24 22:08:12 +02:00
|
|
|
helpers.setupTimeout(this);
|
|
|
|
|
|
|
|
var app = null;
|
|
|
|
|
2017-02-05 11:38:01 +01:00
|
|
|
before(function() {
|
|
|
|
// Set config sample for use in test
|
|
|
|
process.env.MM_CONFIG_FILE = "tests/configs/env.js";
|
|
|
|
});
|
|
|
|
|
2017-07-24 22:08:12 +02:00
|
|
|
describe("Without 'dev' commandline argument", function() {
|
|
|
|
before(function() {
|
|
|
|
return helpers
|
|
|
|
.startApplication({
|
|
|
|
args: ["js/electron.js"]
|
|
|
|
})
|
|
|
|
.then(function(startedApp) {
|
|
|
|
app = startedApp;
|
|
|
|
});
|
|
|
|
});
|
2017-02-05 11:38:01 +01:00
|
|
|
|
2017-07-24 22:08:12 +02:00
|
|
|
after(function() {
|
|
|
|
return helpers.stopApplication(app);
|
|
|
|
});
|
2017-02-05 11:38:01 +01:00
|
|
|
|
2017-07-24 22:08:12 +02:00
|
|
|
it("should not open dev console when absent", function() {
|
2017-02-07 22:29:51 +01:00
|
|
|
return expect(app.browserWindow.isDevToolsOpened()).to.eventually.equal(false);
|
2017-02-05 11:38:01 +01:00
|
|
|
});
|
|
|
|
});
|
|
|
|
|
2017-07-24 22:08:12 +02:00
|
|
|
describe("With 'dev' commandline argument", function() {
|
|
|
|
before(function() {
|
|
|
|
return helpers
|
|
|
|
.startApplication({
|
|
|
|
args: ["js/electron.js", "dev"]
|
|
|
|
})
|
|
|
|
.then(function(startedApp) {
|
|
|
|
app = startedApp;
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
after(function() {
|
|
|
|
return helpers.stopApplication(app);
|
|
|
|
});
|
2017-02-05 11:38:01 +01:00
|
|
|
|
2017-07-24 22:08:12 +02:00
|
|
|
it("should open dev console when provided", function() {
|
2017-02-07 22:29:51 +01:00
|
|
|
return expect(app.browserWindow.isDevToolsOpened()).to.eventually.equal(true);
|
2017-02-05 11:38:01 +01:00
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|