add fix for sliceMultiDayEvents (#3543)

sliceMultiDayEvents occasionally gets the number of events wrong and
produces too many rows

Math.ceil() rounds up over 1.04 so we get an abnormal count

then the calcs for the midnight loop control used different moment()
functions, producing different results

fixes #3542
This commit is contained in:
sam detweiler
2024-09-17 01:01:49 -05:00
committed by GitHub
parent 0faefd109a
commit ea3a323581
5 changed files with 110 additions and 2 deletions

View File

@@ -129,4 +129,22 @@ describe("Calendar module", () => {
await expect(doTestCount()).resolves.toBe(2);
});
});
/*
* RRULE TESTS:
* Add any tests that check rrule functionality here.
*/
describe("sliceMultiDayEvents", () => {
it("Issue #3452 split multiday in Europe", async () => {
await helpers.startApplication("tests/configs/modules/calendar/sliceMultiDayEvents.js", "01 Sept 2024 10:38:00 GMT+02:00", ["js/electron.js"], "Europe/Berlin");
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(6);
});
});
});