Fix undefined error for showSunTime / showMoonTime in clock module (#3146)

Fixes #3143 and adds tests for showSunTime / showMoonTime
This commit is contained in:
Veeck
2023-07-02 22:10:58 +02:00
committed by GitHub
parent 62eb23ba6a
commit f802c85a38
7 changed files with 93 additions and 50 deletions

View File

@@ -71,11 +71,28 @@ describe("Clock module", () => {
});
it("should not show the time when digital clock is shown", async () => {
const elem = await document.querySelector(".clock .digital .time");
const elem = document.querySelector(".clock .digital .time");
expect(elem).toBe(null);
});
});
describe("with showSun/MoonTime enabled", () => {
beforeAll(async () => {
await helpers.startApplication("tests/configs/modules/clock/clock_showSunMoon.js");
await helpers.getDocument();
});
it("should show the sun times", async () => {
const elem = await helpers.waitForElement(".clock .digital .sun");
expect(elem).not.toBe(null);
});
it("should show the moon times", async () => {
const elem = await helpers.waitForElement(".clock .digital .moon");
expect(elem).not.toBe(null);
});
});
describe("with showWeek config enabled", () => {
beforeAll(async () => {
await helpers.startApplication("tests/configs/modules/clock/clock_showWeek.js");