mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-12-12 01:42:19 +00:00
... fixes #3944 introduced with prettier njk linting --------- Co-authored-by: veeck <gitkraken@veeck.de> Co-authored-by: Kristjan ESPERANTO <35647502+KristjanESPERANTO@users.noreply.github.com>
39 lines
1.2 KiB
JavaScript
39 lines
1.2 KiB
JavaScript
const events = require("node:events");
|
|
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 () => {
|
|
// Wait for module content to be rendered, not just the module wrapper
|
|
const moduleContent = await helpers.getElement("#module_0_helloworld .module-content");
|
|
await expect(moduleContent.textContent()).resolves.toContain("Test Display Header");
|
|
expect(global.electronApp.windows()).toHaveLength(1);
|
|
});
|
|
});
|
|
|
|
describe("Development console tests", () => {
|
|
beforeEach(async () => {
|
|
await helpers.startApplication("tests/configs/modules/display.js", null, ["dev"]);
|
|
});
|
|
|
|
afterEach(async () => {
|
|
await helpers.stopApplication();
|
|
});
|
|
|
|
it("should open browserwindow and dev console", async () => {
|
|
while (global.electronApp.windows().length < 2) await events.once(global.electronApp, "window");
|
|
const pageArray = await global.electronApp.windows();
|
|
expect(pageArray).toHaveLength(2);
|
|
for (const page of pageArray) {
|
|
expect(["MagicMirror²", "DevTools"]).toContain(await page.title());
|
|
}
|
|
});
|
|
});
|