MagicMirror/tests/e2e/modules/helloworld_spec.js

38 lines
1012 B
JavaScript
Raw Normal View History

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