mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-08-22 05:07:05 +00:00
Change multiday fullDay Event behaviour (#3396)
Hey! This PR should change the behaviour of starting fullDay events that last several days. The goal was to change the behavior of the "Starting today, ends T" (T=Tomorrow) event, so it should show how many days it will occur from the first day on Before situation: a fullDay event that started 'today' and ends several days later showed Today on the first day. The rest of the days it showed X days left.  Y => Yesterday T => Tomorrow Target situation with this commit: a fullDay event that started 'today' shows 'X days left' from the first day on and 'Today' on the last day.  --------- Co-authored-by: Veeck <github@veeck.de>
This commit is contained in:
@@ -99,6 +99,37 @@ describe("Calendar module", () => {
|
||||
});
|
||||
});
|
||||
|
||||
//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 () => {
|
||||
await helpers.startApplication("tests/configs/modules/calendar/long-fullday-event.js");
|
||||
await helpers.getDocument();
|
||||
});
|
||||
|
||||
it("should contain text 'Ends in' with the left days", async () => {
|
||||
await expect(testTextContain(".calendar .today .time", "Ends in")).resolves.toBe(true);
|
||||
await expect(testTextContain(".calendar .yesterday .time", "Today")).resolves.toBe(true);
|
||||
await expect(testTextContain(".calendar .tomorrow .time", "Tomorrow")).resolves.toBe(true);
|
||||
});
|
||||
it("should contain in total three events", async () => {
|
||||
await expect(testElementLength(".calendar .event", 3)).resolves.toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
describe("FullDayEvent Single day, should show Today", () => {
|
||||
beforeAll(async () => {
|
||||
await helpers.startApplication("tests/configs/modules/calendar/single-fullday-event.js");
|
||||
await helpers.getDocument();
|
||||
});
|
||||
|
||||
it("should contain text 'Today'", async () => {
|
||||
await expect(testTextContain(".calendar .time", "Today")).resolves.toBe(true);
|
||||
});
|
||||
it("should contain in total two events", async () => {
|
||||
await expect(testElementLength(".calendar .event", 2)).resolves.toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
process.setMaxListeners(0);
|
||||
for (let i = -12; i < 12; i++) {
|
||||
describe("Recurring event per timezone", () => {
|
||||
|
Reference in New Issue
Block a user