mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-07-01 13:33:15 +00:00
fixes calendar test by moving it from e2e to electron with fixed date (#3540)
and refactor tests/electron/modules/calendar_spec.js fixes #3532
This commit is contained in:
parent
81351fb4cc
commit
0faefd109a
@ -29,7 +29,7 @@ _This release is scheduled to be released on 2024-10-01._
|
||||
- [weather] Fixed issue with the UK Met Office provider following a change in their API paths and header info.
|
||||
- [core] add check for node_helper loading for multiple instances of same module (#3502)
|
||||
- [weather] Fixed issue for respecting unit config on broadcasted notifications
|
||||
- [tests] Fixes calendar e2e test (#3532)
|
||||
- [tests] Fixes calendar test by moving it from e2e to electron with fixed date (#3532)
|
||||
|
||||
## [2.28.0] - 2024-07-01
|
||||
|
||||
|
@ -88,17 +88,6 @@ describe("Calendar module", () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe("Events from multiple calendars", () => {
|
||||
beforeAll(async () => {
|
||||
await helpers.startApplication("tests/configs/modules/calendar/show-duplicates-in-calendar.js");
|
||||
await helpers.getDocument();
|
||||
});
|
||||
|
||||
it("should show multiple events with the same title and start time from different calendars", async () => {
|
||||
await expect(testElementLength(".calendar .event", 20)).resolves.toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
//Will contain everyday an fullDayEvent that starts today and ends tomorrow, and one starting tomorrow and ending the day after tomorrow
|
||||
describe("FullDayEvent over several days should show how many days are left from the from the starting date on", () => {
|
||||
beforeAll(async () => {
|
||||
|
@ -13,6 +13,15 @@ describe("Calendar module", () => {
|
||||
return true;
|
||||
};
|
||||
|
||||
const doTestCount = async () => {
|
||||
expect(global.page).not.toBeNull();
|
||||
const loc = await global.page.locator(".calendar .event");
|
||||
const elem = loc.first();
|
||||
await elem.waitFor();
|
||||
expect(elem).not.toBeNull();
|
||||
return await loc.count();
|
||||
};
|
||||
|
||||
afterEach(async () => {
|
||||
await helpers.stopApplication();
|
||||
});
|
||||
@ -44,6 +53,13 @@ describe("Calendar module", () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe("Events from multiple calendars", () => {
|
||||
it("should show multiple events with the same title and start time from different calendars", async () => {
|
||||
await helpers.startApplication("tests/configs/modules/calendar/show-duplicates-in-calendar.js", "15 Sep 2024 12:30:00 GMT");
|
||||
await expect(doTestCount()).resolves.toBe(20);
|
||||
});
|
||||
});
|
||||
|
||||
/*
|
||||
* RRULE TESTS:
|
||||
* Add any tests that check rrule functionality here.
|
||||
@ -51,13 +67,7 @@ describe("Calendar module", () => {
|
||||
describe("rrule", () => {
|
||||
it("Issue #3393 recurrence dates past rrule until date", async () => {
|
||||
await helpers.startApplication("tests/configs/modules/calendar/rrule_until.js", "07 Mar 2024 10:38:00 GMT-07:00", ["js/electron.js"], "America/Los_Angeles");
|
||||
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(1);
|
||||
await expect(doTestCount()).resolves.toBe(1);
|
||||
});
|
||||
});
|
||||
|
||||
@ -74,38 +84,20 @@ describe("Calendar module", () => {
|
||||
describe("Exdate: LA crossover DST before midnight GMT", () => {
|
||||
it("LA crossover DST before midnight GMT should have 2 events", async () => {
|
||||
await helpers.startApplication("tests/configs/modules/calendar/exdate_la_before_midnight.js", "19 Oct 2023 12:30:00 GMT-07:00", ["js/electron.js"], "America/Los_Angeles");
|
||||
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(2);
|
||||
await expect(doTestCount()).resolves.toBe(2);
|
||||
});
|
||||
});
|
||||
|
||||
describe("Exdate: LA crossover DST at midnight GMT local STD", () => {
|
||||
it("LA crossover DST before midnight GMT should have 2 events", async () => {
|
||||
await helpers.startApplication("tests/configs/modules/calendar/exdate_la_at_midnight_std.js", "19 Oct 2023 12:30:00 GMT-07:00", ["js/electron.js"], "America/Los_Angeles");
|
||||
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(2);
|
||||
await expect(doTestCount()).resolves.toBe(2);
|
||||
});
|
||||
});
|
||||
describe("Exdate: LA crossover DST at midnight GMT local DST", () => {
|
||||
it("LA crossover DST before midnight GMT should have 2 events", async () => {
|
||||
await helpers.startApplication("tests/configs/modules/calendar/exdate_la_at_midnight_dst.js", "19 Oct 2023 12:30:00 GMT-07:00", ["js/electron.js"], "America/Los_Angeles");
|
||||
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(2);
|
||||
await expect(doTestCount()).resolves.toBe(2);
|
||||
});
|
||||
});
|
||||
|
||||
@ -122,37 +114,19 @@ describe("Calendar module", () => {
|
||||
describe("Exdate: SYD crossover DST before midnight GMT", () => {
|
||||
it("LA crossover DST before midnight GMT should have 2 events", async () => {
|
||||
await helpers.startApplication("tests/configs/modules/calendar/exdate_syd_before_midnight.js", "14 Sep 2023 12:30:00 GMT+10:00", ["js/electron.js"], "Australia/Sydney");
|
||||
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(2);
|
||||
await expect(doTestCount()).resolves.toBe(2);
|
||||
});
|
||||
});
|
||||
describe("Exdate: SYD crossover DST at midnight GMT local STD", () => {
|
||||
it("LA crossover DST before midnight GMT should have 2 events", async () => {
|
||||
await helpers.startApplication("tests/configs/modules/calendar/exdate_syd_at_midnight_std.js", "14 Sep 2023 12:30:00 GMT+10:00", ["js/electron.js"], "Australia/Sydney");
|
||||
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(2);
|
||||
await expect(doTestCount()).resolves.toBe(2);
|
||||
});
|
||||
});
|
||||
describe("Exdate: SYD crossover DST at midnight GMT local DST", () => {
|
||||
it("SYD crossover DST at midnight GMT local DST should have 2 events", async () => {
|
||||
await helpers.startApplication("tests/configs/modules/calendar/exdate_syd_at_midnight_dst.js", "14 Sep 2023 12:30:00 GMT+10:00", ["js/electron.js"], "Australia/Sydney");
|
||||
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(2);
|
||||
await expect(doTestCount()).resolves.toBe(2);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user