Skip to content

Commit

Permalink
fix calendar test exdate check (#3293)
Browse files Browse the repository at this point in the history
fixes #3291
  • Loading branch information
khassel authored Dec 17, 2023
1 parent 319a921 commit a7af76b
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 12 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
11 changes: 0 additions & 11 deletions tests/e2e/modules/calendar_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
16 changes: 15 additions & 1 deletion tests/electron/modules/calendar_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};
Expand Down Expand Up @@ -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);
});
});
});

0 comments on commit a7af76b

Please sign in to comment.