MagicMirror/tests/e2e/modules/helloworld_spec.js

34 lines
996 B
JavaScript
Raw Normal View History

const helpers = require("../helpers/global-setup");
2021-09-25 23:51:32 +02:00
describe("Test helloworld module", () => {
afterAll(async () => {
await helpers.stopApplication();
2021-09-25 23:51:32 +02:00
});
describe("helloworld set config text", () => {
beforeAll(async () => {
2021-09-25 23:51:32 +02:00
helpers.startApplication("tests/configs/modules/helloworld/helloworld.js");
await helpers.getDocument();
2021-09-25 23:51:32 +02:00
});
it("Test message helloworld module", async () => {
const elem = await helpers.waitForElement(".helloworld");
expect(elem).not.toBe(null);
expect(elem.textContent).toContain("Test HelloWorld Module");
2021-09-25 23:51:32 +02:00
});
});
describe("helloworld default config text", () => {
beforeAll(async () => {
2021-09-25 23:51:32 +02:00
helpers.startApplication("tests/configs/modules/helloworld/helloworld_default.js");
await helpers.getDocument();
2021-09-25 23:51:32 +02:00
});
it("Test message helloworld module", async () => {
const elem = await helpers.waitForElement(".helloworld");
expect(elem).not.toBe(null);
expect(elem.textContent).toContain("Hello World!");
2021-09-25 23:51:32 +02:00
});
});
});