mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-06-27 19:53:36 +00:00
first PR for #2942 - added new electron tests for calendar which test new css classes from https://github.com/MichMich/MagicMirror/pull/2939 - moved some compliments tests from `e2e` to `electron` because of date mocking - removed mock stuff from compliments module
36 lines
1.0 KiB
JavaScript
36 lines
1.0 KiB
JavaScript
const helpers = require("./helpers/global-setup");
|
|
|
|
describe("Electron app environment", () => {
|
|
beforeEach(async () => {
|
|
await helpers.startApplication("tests/configs/modules/display.js");
|
|
});
|
|
|
|
afterEach(async () => {
|
|
await helpers.stopApplication();
|
|
});
|
|
|
|
it("should open browserwindow", async () => {
|
|
const module = await helpers.getElement("#module_0_helloworld");
|
|
expect(await module.textContent()).toContain("Test Display Header");
|
|
expect(await global.electronApp.windows().length).toBe(1);
|
|
});
|
|
});
|
|
|
|
describe("Development console tests", () => {
|
|
beforeEach(async () => {
|
|
await helpers.startApplication("tests/configs/modules/display.js", null, ["js/electron.js", "dev"]);
|
|
});
|
|
|
|
afterEach(async () => {
|
|
await helpers.stopApplication();
|
|
});
|
|
|
|
it("should open browserwindow and dev console", async () => {
|
|
const pageArray = await global.electronApp.windows();
|
|
expect(pageArray.length).toBe(2);
|
|
for (const page of pageArray) {
|
|
expect(["MagicMirror²", "DevTools"]).toContain(await page.title());
|
|
}
|
|
});
|
|
});
|