mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-08-21 21:00:57 +00:00
refactor tests in 3 categories unit, e2e and electron
This commit is contained in:
53
tests/electron/dev_console.js
Normal file
53
tests/electron/dev_console.js
Normal file
@@ -0,0 +1,53 @@
|
||||
const helpers = require("./global-setup");
|
||||
|
||||
describe("Development console tests", function () {
|
||||
helpers.setupTimeout(this);
|
||||
|
||||
let app = null;
|
||||
|
||||
beforeAll(function () {
|
||||
// Set config sample for use in test
|
||||
process.env.MM_CONFIG_FILE = "tests/configs/env.js";
|
||||
});
|
||||
|
||||
describe("Without 'dev' commandline argument", function () {
|
||||
beforeAll(function () {
|
||||
return helpers
|
||||
.startApplication({
|
||||
args: ["js/electron.js"]
|
||||
})
|
||||
.then(function (startedApp) {
|
||||
app = startedApp;
|
||||
});
|
||||
});
|
||||
|
||||
afterAll(function () {
|
||||
return helpers.stopApplication(app);
|
||||
});
|
||||
|
||||
it("should not open dev console when absent", async function () {
|
||||
await app.client.waitUntilWindowLoaded();
|
||||
return expect(await app.browserWindow.isDevToolsOpened()).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
describe("With 'dev' commandline argument", function () {
|
||||
beforeAll(function () {
|
||||
return helpers
|
||||
.startApplication({
|
||||
args: ["js/electron.js", "dev"]
|
||||
})
|
||||
.then(function (startedApp) {
|
||||
app = startedApp;
|
||||
});
|
||||
});
|
||||
|
||||
afterAll(function () {
|
||||
return helpers.stopApplication(app);
|
||||
});
|
||||
|
||||
it("should open dev console when provided", async function () {
|
||||
expect(await app.client.getWindowCount()).toBe(2);
|
||||
});
|
||||
});
|
||||
});
|
Reference in New Issue
Block a user