mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-08-21 12:55:22 +00:00
improve waitForElement
This commit is contained in:
@@ -8,26 +8,28 @@ describe("Test helloworld module", function () {
|
||||
describe("helloworld set config text", function () {
|
||||
beforeAll(function (done) {
|
||||
helpers.startApplication("tests/configs/modules/helloworld/helloworld.js");
|
||||
helpers.getDocument(done, 1000);
|
||||
helpers.getDocument(done);
|
||||
});
|
||||
|
||||
it("Test message helloworld module", function () {
|
||||
const elem = document.querySelector(".helloworld");
|
||||
expect(elem).not.toBe(null);
|
||||
expect(elem.textContent).toContain("Test HelloWorld Module");
|
||||
helpers.waitForElement(".helloworld").then((elem) => {
|
||||
expect(elem).not.toBe(null);
|
||||
expect(elem.textContent).toContain("Test HelloWorld Module");
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe("helloworld default config text", function () {
|
||||
beforeAll(function (done) {
|
||||
helpers.startApplication("tests/configs/modules/helloworld/helloworld_default.js");
|
||||
helpers.getDocument(done, 1000);
|
||||
helpers.getDocument(done);
|
||||
});
|
||||
|
||||
it("Test message helloworld module", function () {
|
||||
const elem = document.querySelector(".helloworld");
|
||||
expect(elem).not.toBe(null);
|
||||
expect(elem.textContent).toContain("Hello World!");
|
||||
helpers.waitForElement(".helloworld").then((elem) => {
|
||||
expect(elem).not.toBe(null);
|
||||
expect(elem.textContent).toContain("Hello World!");
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user