From a7af76b61945ba2d974042d801d58e9aaf336981 Mon Sep 17 00:00:00 2001 From: Karsten Hassel Date: Sun, 17 Dec 2023 07:19:15 +0100 Subject: [PATCH] fix calendar test exdate check (#3293) fixes #3291 --- CHANGELOG.md | 1 + tests/e2e/modules/calendar_spec.js | 11 ----------- tests/electron/modules/calendar_spec.js | 16 +++++++++++++++- 3 files changed, 16 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index be9bceec0c..0272b1039a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -45,6 +45,7 @@ _This release is scheduled to be released on 2024-01-01._ - Fix updatanotification (update_helper.js): catch error if reponse is not an JSON format (check PM2) - Fix missing typeof in calendar module - Fix style issues after prettier update +- Fix calendar test (#3291) by moving "Exdate check" from e2e to electron to run on a Thursday ## [2.25.0] - 2023-10-01 diff --git a/tests/e2e/modules/calendar_spec.js b/tests/e2e/modules/calendar_spec.js index 4d1a231c5f..da4970248d 100644 --- a/tests/e2e/modules/calendar_spec.js +++ b/tests/e2e/modules/calendar_spec.js @@ -87,17 +87,6 @@ describe("Calendar module", () => { }); }); - describe("exdate check", () => { - beforeAll(async () => { - await helpers.startApplication("tests/configs/modules/calendar/exdate.js"); - await helpers.getDocument(); - }); - - it("should show the recurring event 51 times (excluded once) in a 364-day (inclusive) period", async () => { - await expect(testElementLength(".calendar .event", 51)).resolves.toBe(true); - }); - }); - describe("Events from multiple calendars", () => { beforeAll(async () => { await helpers.startApplication("tests/configs/modules/calendar/show-duplicates-in-calendar.js"); diff --git a/tests/electron/modules/calendar_spec.js b/tests/electron/modules/calendar_spec.js index be488f3553..ac8a614d13 100644 --- a/tests/electron/modules/calendar_spec.js +++ b/tests/electron/modules/calendar_spec.js @@ -7,7 +7,7 @@ describe("Calendar module", () => { * @returns {boolean} result */ const doTest = async (cssClass) => { - let elem = await helpers.getElement(`.calendar .module-content .event${cssClass}`); + const elem = await helpers.getElement(`.calendar .module-content .event${cssClass}`); await expect(elem.isVisible()).resolves.toBe(true); return true; }; @@ -42,4 +42,18 @@ describe("Calendar module", () => { await expect(doTest(".dayAfterTomorrow")).resolves.toBe(true); }); }); + + describe("Exdate check", () => { + it("should show the recurring event 51 times (excluded once) in a 364-day (inclusive) period", async () => { + // test must run on a Thursday + await helpers.startApplication("tests/configs/modules/calendar/exdate.js", "14 Dec 2023 12:30:00 GMT"); + expect(global.page).not.toBeNull(); + const loc = await global.page.locator(".calendar .event"); + const elem = loc.first(); + await elem.waitFor(); + expect(elem).not.toBeNull(); + const cnt = await loc.count(); + expect(cnt).toBe(51); + }); + }); });