Skip to content

Commit a7af76b

Browse files
authored
fix calendar test exdate check (#3293)
fixes #3291
1 parent 319a921 commit a7af76b

File tree

3 files changed

+16
-12
lines changed

3 files changed

+16
-12
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ _This release is scheduled to be released on 2024-01-01._
4545
- Fix updatanotification (update_helper.js): catch error if reponse is not an JSON format (check PM2)
4646
- Fix missing typeof in calendar module
4747
- Fix style issues after prettier update
48+
- Fix calendar test (#3291) by moving "Exdate check" from e2e to electron to run on a Thursday
4849

4950
## [2.25.0] - 2023-10-01
5051

tests/e2e/modules/calendar_spec.js

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -87,17 +87,6 @@ describe("Calendar module", () => {
8787
});
8888
});
8989

90-
describe("exdate check", () => {
91-
beforeAll(async () => {
92-
await helpers.startApplication("tests/configs/modules/calendar/exdate.js");
93-
await helpers.getDocument();
94-
});
95-
96-
it("should show the recurring event 51 times (excluded once) in a 364-day (inclusive) period", async () => {
97-
await expect(testElementLength(".calendar .event", 51)).resolves.toBe(true);
98-
});
99-
});
100-
10190
describe("Events from multiple calendars", () => {
10291
beforeAll(async () => {
10392
await helpers.startApplication("tests/configs/modules/calendar/show-duplicates-in-calendar.js");

tests/electron/modules/calendar_spec.js

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ describe("Calendar module", () => {
77
* @returns {boolean} result
88
*/
99
const doTest = async (cssClass) => {
10-
let elem = await helpers.getElement(`.calendar .module-content .event${cssClass}`);
10+
const elem = await helpers.getElement(`.calendar .module-content .event${cssClass}`);
1111
await expect(elem.isVisible()).resolves.toBe(true);
1212
return true;
1313
};
@@ -42,4 +42,18 @@ describe("Calendar module", () => {
4242
await expect(doTest(".dayAfterTomorrow")).resolves.toBe(true);
4343
});
4444
});
45+
46+
describe("Exdate check", () => {
47+
it("should show the recurring event 51 times (excluded once) in a 364-day (inclusive) period", async () => {
48+
// test must run on a Thursday
49+
await helpers.startApplication("tests/configs/modules/calendar/exdate.js", "14 Dec 2023 12:30:00 GMT");
50+
expect(global.page).not.toBeNull();
51+
const loc = await global.page.locator(".calendar .event");
52+
const elem = loc.first();
53+
await elem.waitFor();
54+
expect(elem).not.toBeNull();
55+
const cnt = await loc.count();
56+
expect(cnt).toBe(51);
57+
});
58+
});
4559
});

0 commit comments

Comments
 (0)