MagicMirror/tests/e2e/modules/helloworld_spec.js

36 lines
1.0 KiB
JavaScript
Raw Normal View History

2021-09-25 23:51:32 +02:00
const helpers = require("../global-setup");
describe("Test helloworld module", function () {
afterAll(async function () {
await helpers.stopApplication();
2021-09-25 23:51:32 +02:00
});
describe("helloworld set config text", function () {
beforeAll(function (done) {
helpers.startApplication("tests/configs/modules/helloworld/helloworld.js");
2022-01-13 21:12:15 +01:00
helpers.getDocument(done);
2021-09-25 23:51:32 +02:00
});
2021-09-26 21:58:59 +02:00
it("Test message helloworld module", function () {
2022-01-13 21:12:15 +01:00
helpers.waitForElement(".helloworld").then((elem) => {
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", function () {
beforeAll(function (done) {
helpers.startApplication("tests/configs/modules/helloworld/helloworld_default.js");
2022-01-13 21:12:15 +01:00
helpers.getDocument(done);
2021-09-25 23:51:32 +02:00
});
2021-09-26 21:58:59 +02:00
it("Test message helloworld module", function () {
2022-01-13 21:12:15 +01:00
helpers.waitForElement(".helloworld").then((elem) => {
expect(elem).not.toBe(null);
expect(elem.textContent).toContain("Hello World!");
});
2021-09-25 23:51:32 +02:00
});
});
});