Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix calendar test exdate check #3293

Merged
merged 1 commit into from
Dec 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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);
});
});
});