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

new node-ical version v0.19.0 breaks a bunch of calendar tests #3537

Open
khassel opened this issue Sep 14, 2024 · 14 comments
Open

new node-ical version v0.19.0 breaks a bunch of calendar tests #3537

khassel opened this issue Sep 14, 2024 · 14 comments
Assignees

Comments

@khassel
Copy link
Collaborator

khassel commented Sep 14, 2024

electron tests:

 FAIL   electron  tests/electron/modules/calendar_spec.js (32.671 s)
  Calendar module
    Test css classes
      ✓ has css class dayBeforeYesterday (2646 ms)
      ✓ has css class yesterday (2981 ms)
      ✓ has css class today (2666 ms)
      ✓ has css class tomorrow (2650 ms)
      ✓ has css class dayAfterTomorrow (2710 ms)
    rrule
      ✕ Issue #3393 recurrence dates past rrule until date (2669 ms)
    Exdate: LA crossover DST before midnight GMT
      ✕ LA crossover DST before midnight GMT should have 2 events (2669 ms)
    Exdate: LA crossover DST at midnight GMT local STD
      ✕ LA crossover DST before midnight GMT should have 2 events (2709 ms)
    Exdate: LA crossover DST at midnight GMT local DST
      ✕ LA crossover DST before midnight GMT should have 2 events (2670 ms)
    Exdate: SYD crossover DST before midnight GMT
      ✕ LA crossover DST before midnight GMT should have 2 events (2822 ms)
    Exdate: SYD crossover DST at midnight GMT local STD
      ✕ LA crossover DST before midnight GMT should have 2 events (2699 ms)
    Exdate: SYD crossover DST at midnight GMT local DST
      ✕ SYD crossover DST at midnight GMT local DST should have 2 events (2648 ms)

  ● Calendar module › rrule › Issue #3393 recurrence dates past rrule until date

    expect(received).toBe(expected) // Object.is equality

    Expected: 1
    Received: 2

      58 |                      expect(elem).not.toBeNull();
      59 |                      const cnt = await loc.count();
    > 60 |                      expect(cnt).toBe(1);
         |                                  ^
      61 |              });
      62 |      });
      63 |

      at Object.toBe (tests/electron/modules/calendar_spec.js:60:16)

  ● Calendar module › Exdate: LA crossover DST before midnight GMT › LA crossover DST before midnight GMT should have 2 events

    expect(received).toBe(expected) // Object.is equality

    Expected: 2
    Received: 3

      81 |                      expect(elem).not.toBeNull();
      82 |                      const cnt = await loc.count();
    > 83 |                      expect(cnt).toBe(2);
         |                                  ^
      84 |              });
      85 |      });
      86 |

      at Object.toBe (tests/electron/modules/calendar_spec.js:83:16)

  ● Calendar module › Exdate: LA crossover DST at midnight GMT local STD › LA crossover DST before midnight GMT should have 2 events

    expect(received).toBe(expected) // Object.is equality

    Expected: 2
    Received: 4

      94 |                      expect(elem).not.toBeNull();
      95 |                      const cnt = await loc.count();
    > 96 |                      expect(cnt).toBe(2);
         |                                  ^
      97 |              });
      98 |      });
      99 |      describe("Exdate: LA crossover DST at midnight GMT local DST", () => {

      at Object.toBe (tests/electron/modules/calendar_spec.js:96:16)

  ● Calendar module › Exdate: LA crossover DST at midnight GMT local DST › LA crossover DST before midnight GMT should have 2 events

    expect(received).toBe(expected) // Object.is equality

    Expected: 2
    Received: 5

      106 |                     expect(elem).not.toBeNull();
      107 |                     const cnt = await loc.count();
    > 108 |                     expect(cnt).toBe(2);
          |                                 ^
      109 |             });
      110 |     });
      111 |

      at Object.toBe (tests/electron/modules/calendar_spec.js:108:16)

  ● Calendar module › Exdate: SYD crossover DST before midnight GMT › LA crossover DST before midnight GMT should have 2 events

    expect(received).toBe(expected) // Object.is equality

    Expected: 2
    Received: 5

      129 |                     expect(elem).not.toBeNull();
      130 |                     const cnt = await loc.count();
    > 131 |                     expect(cnt).toBe(2);
          |                                 ^
      132 |             });
      133 |     });
      134 |     describe("Exdate: SYD crossover DST at midnight GMT local STD", () => {

      at Object.toBe (tests/electron/modules/calendar_spec.js:131:16)

  ● Calendar module › Exdate: SYD crossover DST at midnight GMT local STD › LA crossover DST before midnight GMT should have 2 events

    expect(received).toBe(expected) // Object.is equality

    Expected: 2
    Received: 4

      141 |                     expect(elem).not.toBeNull();
      142 |                     const cnt = await loc.count();
    > 143 |                     expect(cnt).toBe(2);
          |                                 ^
      144 |             });
      145 |     });
      146 |     describe("Exdate: SYD crossover DST at midnight GMT local DST", () => {

      at Object.toBe (tests/electron/modules/calendar_spec.js:143:16)

  ● Calendar module › Exdate: SYD crossover DST at midnight GMT local DST › SYD crossover DST at midnight GMT local DST should have 2 events

    expect(received).toBe(expected) // Object.is equality

    Expected: 2
    Received: 3

      153 |                     expect(elem).not.toBeNull();
      154 |                     const cnt = await loc.count();
    > 155 |                     expect(cnt).toBe(2);
          |                                 ^
      156 |             });
      157 |     });
      158 | });

      at Object.toBe (tests/electron/modules/calendar_spec.js:155:16)

e2e tests:

 FAIL   e2e  tests/e2e/modules/calendar_spec.js (116.9 s)
  Calendar module
    Default configuration
      ✓ should show the default maximumEntries of 10 (1317 ms)
      ✓ should show the default calendar symbol in each event (202 ms)
    Custom configuration
      ✓ should show the custom maximumEntries of 5 (1312 ms)
      ✕ should show the custom calendar symbol in four events (207 ms)
      ✕ should show a customEvent calendar symbol in one event (19991 ms)
      ✕ should show a customEvent calendar eventClass in one event (20007 ms)
      ✕ should show two custom icons for repeating events (205 ms)
      ✓ should show two custom icons for day events (202 ms)
    Recurring event
      ✓ should show the recurring birthday event 6 times (1329 ms)
    Events from multiple calendars
      ✓ should show multiple events with the same title and start time from different calendars (1326 ms)
    FullDayEvent over several days should show how many days are left from the from the starting date on
      ✓ should contain text 'Ends in' with the left days (1726 ms)
      ✓ should contain in total three events (201 ms)
    FullDayEvent Single day, should show Today
      ✓ should contain text 'Today' (1240 ms)
      ✓ should contain in total two events (201 ms)
    Recurring event per timezone
      ✓ should contain text "Mar 25th" in timezone UTC 12 (1264 ms)
      ✓ should contain text "Mar 25th" in timezone UTC 11 (1309 ms)
      ✓ should contain text "Mar 25th" in timezone UTC 10 (1243 ms)
      ✓ should contain text "Mar 25th" in timezone UTC 9 (1316 ms)
      ✓ should contain text "Mar 25th" in timezone UTC 8 (1302 ms)
      ✓ should contain text "Mar 25th" in timezone UTC 7 (1326 ms)
      ✓ should contain text "Mar 25th" in timezone UTC 6 (1323 ms)
      ✓ should contain text "Mar 25th" in timezone UTC 5 (1308 ms)
      ✓ should contain text "Mar 25th" in timezone UTC 4 (1325 ms)
      ✓ should contain text "Mar 25th" in timezone UTC 3 (1341 ms)
      ✓ should contain text "Mar 25th" in timezone UTC 2 (1358 ms)
      ✓ should contain text "Mar 25th" in timezone UTC 1 (1870 ms)
      ✓ should contain text "Mar 25th" in timezone UTC 0 (2519 ms)
      ✓ should contain text "Mar 25th" in timezone UTC -1 (1337 ms)
      ✓ should contain text "Mar 25th" in timezone UTC -2 (1305 ms)
      ✓ should contain text "Mar 25th" in timezone UTC -3 (1331 ms)
      ✓ should contain text "Mar 25th" in timezone UTC -4 (1348 ms)
      ✓ should contain text "Mar 25th" in timezone UTC -5 (1300 ms)
      ✓ should contain text "Mar 25th" in timezone UTC -6 (1273 ms)
      ✓ should contain text "Mar 25th" in timezone UTC -7 (1280 ms)
      ✓ should contain text "Mar 25th" in timezone UTC -8 (1485 ms)
      ✓ should contain text "Mar 25th" in timezone UTC -9 (1362 ms)
      ✓ should contain text "Mar 25th" in timezone UTC -10 (1345 ms)
      ✓ should contain text "Mar 25th" in timezone UTC -11 (1364 ms)
    Changed port
      ✓ should return TestEvents (1300 ms)
    Basic auth
      ✓ should return TestEvents (1374 ms)
    Basic auth by default
      ✓ should return TestEvents (1280 ms)
    Basic auth backward compatibility configuration: DEPRECATED
      ✓ should return TestEvents (1328 ms)
    Fail Basic auth
      ✓ should show Unauthorized error (1318 ms)

  ● Calendar module › Custom configuration › should show the custom calendar symbol in four events

    expect(received).resolves.toBe()

    Received promise rejected instead of resolved
    Rejected to value: [Error: expect(received).toHaveLength(expected)·
    Expected length: 4
    Received length: 5
    Received object: [<span class="fas fa-fw fa-birthday-cake" />, <span class="fas fa-fw fa-birthday-cake" style="padding-left: 5px;" />, <span class="fas fa-fw fa-birthday-cake" style="padding-left: 5px;" />, <span class="fas fa-fw fa-birthday-cake" style="padding-left: 5px;" />, <span class="fas fa-fw fa-birthday-cake" style="padding-left: 5px;" />]]

      58 |
      59 |              it("should show the custom calendar symbol in four events", async () => {
    > 60 |                      await expect(testElementLength(".calendar .event .fa-birthday-cake", 4)).resolves.toBe(true);
         |                            ^
      61 |              });
      62 |
      63 |              it("should show a customEvent calendar symbol in one event", async () => {

      at expect (node_modules/expect/build/index.js:113:15)
      at Object.expect (tests/e2e/modules/calendar_spec.js:60:10)

  ● Calendar module › Custom configuration › should show a customEvent calendar symbol in one event

    thrown: "Exceeded timeout of 20000 ms for a test.
    Add a timeout value to this test to increase the timeout, if this is a long-running test. See https://jestjs.io/docs/api#testname-fn-timeout."

      61 |              });
      62 |
    > 63 |              it("should show a customEvent calendar symbol in one event", async () => {
         |              ^
      64 |                      await expect(testElementLength(".calendar .event .fa-dice", 1)).resolves.toBe(true);
      65 |              });
      66 |

      at it (tests/e2e/modules/calendar_spec.js:63:3)
      at describe (tests/e2e/modules/calendar_spec.js:49:2)
      at Object.describe (tests/e2e/modules/calendar_spec.js:4:1)

  ● Calendar module › Custom configuration › should show a customEvent calendar eventClass in one event

    thrown: "Exceeded timeout of 20000 ms for a test.
    Add a timeout value to this test to increase the timeout, if this is a long-running test. See https://jestjs.io/docs/api#testname-fn-timeout."

      65 |              });
      66 |
    > 67 |              it("should show a customEvent calendar eventClass in one event", async () => {
         |              ^
      68 |                      await expect(testElementLength(".calendar .event.undo", 1)).resolves.toBe(true);
      69 |              });
      70 |

      at it (tests/e2e/modules/calendar_spec.js:67:3)
      at describe (tests/e2e/modules/calendar_spec.js:49:2)
      at Object.describe (tests/e2e/modules/calendar_spec.js:4:1)

  ● Calendar module › Custom configuration › should show two custom icons for repeating events

    expect(received).resolves.toBe()

    Received promise rejected instead of resolved
    Rejected to value: [Error: expect(received).toHaveLength(expected)·
    Expected length: 2
    Received length: 3
    Received object: [<span class="fas fa-fw fa-undo" />, <span class="fas fa-fw fa-undo" />, <span class="fas fa-fw fa-undo" style="padding-left: 5px;" />]]

      70 |
      71 |              it("should show two custom icons for repeating events", async () => {
    > 72 |                      await expect(testElementLength(".calendar .event .fa-undo", 2)).resolves.toBe(true);
         |                            ^
      73 |              });
      74 |
      75 |              it("should show two custom icons for day events", async () => {

      at expect (node_modules/expect/build/index.js:113:15)
      at Object.expect (tests/e2e/modules/calendar_spec.js:72:10)
@bugsounet
Copy link
Contributor

@khassel

Are you sure about this ?
because we use node-ical v0.19.0 in package-lock on develop branch

see there and there

@khassel
Copy link
Collaborator Author

khassel commented Sep 28, 2024

Thanks. Will check this again later ...

@khassel
Copy link
Collaborator Author

khassel commented Sep 28, 2024

sadly the errors still exist.

We had a problem with package-lock.json, fix for this is on the way.

@sdetweil
Copy link
Collaborator

I tested with node-ical 19, and the problem is that the EXDATE entries are not returned in the parsed data
I opened jens-maus/node-ical#338
to document the problem.

all of the failing testcases have EXDATE entries

@sdetweil
Copy link
Collaborator

sdetweil commented Sep 30, 2024

I think I have fix for that problem (they were returned but converted to UTC time so never will match)

BUT I think I have a fix for all the date conversion problems. (all our testcases pass with all the conversions commented out)

want more testing..

@sdetweil
Copy link
Collaborator

sdetweil commented Oct 7, 2024

see this.. waiting on user test for submitting PR here and node-ical
all testcases in both run successfully..

here is a test version of the fixes for all kinds of date problems.

best to make a new folder and git clone there

git  clone https://github.com/sdetweil/MagicMirror
git checkout fixcaldates
npm run install-mm

copy your config.js and custom.css from the prior folder
and the non-default modules you have installed..

this ONLY changes the default calendar
but DOES ship an updated node-ical library too

if you need to fall back, just rename the folders around again so that
your original is called MagicMirror

all the testcases for node-ical and MagicMirror execute successfully.

the 'BIG' change here is to get the local NON-TZ dates for the
rrule.between()

all the checking and conversion code is commented out or not used
the node-ical fixes are for excluded dates (exdate) values being adjusted for DST/STD time.. waiting to submit that PR

one fix in calendar.js for checking if a past date was too far back,
but it never checked to see IF the event date was in the past.. (before today) so it chopped off too many

and one change in calendarfetcher.js to put out a better diagnostic message of the parsed data.. (exdate was excluded cause JSON stringify couldn't convert the complex structure)

@sdetweil
Copy link
Collaborator

added more testcases

anyone that wants to test still use my fork instructions above
if you already downloaded my fork, please

fixed a bunch more testcases.. updated tests

both mm and node-ical changed

cd MagicMirror
git pull
rm -rf node_modules
npm run install-mm

@khassel
Copy link
Collaborator Author

khassel commented Oct 11, 2024

I tested your branch and I still get some test errors:

 FAIL   unit  tests/unit/modules/default/calendar/calendar_fetcher_utils_bad_rrule.js
  Calendar fetcher utils test
    filterEvents
      ✕ no events, not crash (53 ms)

  ● Calendar fetcher utils test › filterEvents › no events, not crash

    expect(received).toHaveLength(expected)

    Expected length: 0
    Received length: 2
    Received array:  [{"class": undefined, "description": "ongoingEvent", "endDate": "1728689046900", "fullDayEvent": false, "geo": false, "location": false, "startDate": "1728681846899", "title": "ongoingEvent"}, {"class": undefined, "description": "upcomingEvent", "endDate": "1728692646900", "fullDayEvent": false, "geo": false, "location": false, "startDate": "1728689046900", "title": "upcomingEvent"}]

      24 |                      );
      25 |
    > 26 |                      expect(filteredEvents).toHaveLength(0);
         |                                             ^
      27 |              });
      28 |      });
      29 | });

      at Object.toHaveLength (tests/unit/modules/default/calendar/calendar_fetcher_utils_bad_rrule.js:26:27)

 FAIL   electron  tests/electron/modules/calendar_spec.js (56.808 s)
  Calendar module
    Test css classes
      ✓ has css class dayBeforeYesterday (2326 ms)
      ✓ has css class yesterday (2312 ms)
      ✓ has css class today (2258 ms)
      ✓ has css class tomorrow (2309 ms)
      ✓ has css class dayAfterTomorrow (2280 ms)
    Events from multiple calendars
      ✓ should show multiple events with the same title and start time from different calendars (2270 ms)
    rrule
      ✓ Issue #3393 recurrence dates past rrule until date (2340 ms)
    Exdate: LA crossover DST before midnight GMT
      ✓ LA crossover DST before midnight GMT should have 2 events (2270 ms)
    Exdate: LA crossover DST at midnight GMT local STD
      ✓ LA crossover DST before midnight GMT should have 2 events (2330 ms)
    Exdate: LA crossover DST at midnight GMT local DST
      ✓ LA crossover DST before midnight GMT should have 2 events (2330 ms)
    Exdate: SYD crossover DST before midnight GMT
      ✓ LA crossover DST before midnight GMT should have 2 events (2250 ms)
    Exdate: SYD crossover DST at midnight GMT local STD
      ✓ LA crossover DST before midnight GMT should have 2 events (2289 ms)
    Exdate: SYD crossover DST at midnight GMT local DST
      ✓ SYD crossover DST at midnight GMT local DST should have 2 events (2309 ms)
    sliceMultiDayEvents
      ✓ Issue #3452 split multiday in Europe (2269 ms)
    germany timezone
      ✓ Issue #unknown fullday timezone East of UTC edge (2249 ms)
    germany all day repeating moved (recurrence and exdate)
      ✓ Issue #unknown fullday timezone East of UTC event moved (2270 ms)
    chicago late in timezone
      ✕ Issue #unknown rrule US close to timezone edge (20071 ms)

  ● Calendar module › chicago late in timezone › Issue #unknown rrule US close to timezone edge

    thrown: "Exceeded timeout of 20000 ms for a test.
    Add a timeout value to this test to increase the timeout, if this is a long-running test. See https://jestjs.io/docs/api#testname-fn-timeout."

      166 |
      167 |     describe("chicago late in timezone", () => {
    > 168 |             it("Issue #unknown rrule US close to timezone edge", async () => {
          |             ^
      169 |                     await helpers.startApplication("tests/configs/modules/calendar/chicago_late_in_timezone.js", "01 Sept 2024 10:38:00 GMT-06:00", ["js/electron.js"], "Europe/Berlin");
      170 |                     await expect(doTestTableContent(".calendar .event", ".time", "10th.Sep, 20:15")).resolves.toBe(true);
      171 |             });

      at it (tests/electron/modules/calendar_spec.js:168:3)
      at describe (tests/electron/modules/calendar_spec.js:167:2)
      at Object.describe (tests/electron/modules/calendar_spec.js:3:1)

 FAIL   e2e  tests/e2e/modules/calendar_spec.js (58.988 s)
  Calendar module
    Default configuration
      ✓ should show the default maximumEntries of 10 (1302 ms)
      ✓ should show the default calendar symbol in each event (201 ms)
    Custom configuration
      ✓ should show the custom maximumEntries of 5 (1204 ms)
      ✓ should show the custom calendar symbol in four events (201 ms)
      ✓ should show a customEvent calendar symbol in one event (202 ms)
      ✓ should show a customEvent calendar eventClass in one event (201 ms)
      ✓ should show two custom icons for repeating events (202 ms)
      ✓ should show two custom icons for day events (202 ms)
    Recurring event
      ✓ should show the recurring birthday event 6 times (1306 ms)
    FullDayEvent over several days should show how many days are left from the from the starting date on
      ✕ should contain text 'Ends in' with the left days (1212 ms)
      ✕ should contain in total three events (204 ms)
    FullDayEvent Single day, should show Today
      ✓ should contain text 'Today' (1202 ms)
      ✕ should contain in total two events (203 ms)
    Recurring event per timezone
      ✓ should contain text "Mar 25th" in timezone UTC 12 (1203 ms)
      ✓ should contain text "Mar 25th" in timezone UTC 11 (1206 ms)
      ✓ should contain text "Mar 25th" in timezone UTC 10 (1205 ms)
      ✓ should contain text "Mar 25th" in timezone UTC 9 (1313 ms)
      ✓ should contain text "Mar 25th" in timezone UTC 8 (1203 ms)
      ✓ should contain text "Mar 25th" in timezone UTC 7 (1216 ms)
      ✓ should contain text "Mar 25th" in timezone UTC 6 (1207 ms)
      ✓ should contain text "Mar 25th" in timezone UTC 5 (1207 ms)
      ✓ should contain text "Mar 25th" in timezone UTC 4 (1203 ms)
      ✓ should contain text "Mar 25th" in timezone UTC 3 (1207 ms)
      ✓ should contain text "Mar 25th" in timezone UTC 2 (1314 ms)
      ✓ should contain text "Mar 25th" in timezone UTC 1 (1204 ms)
      ✓ should contain text "Mar 25th" in timezone UTC 0 (1251 ms)
      ✓ should contain text "Mar 25th" in timezone UTC -1 (1202 ms)
      ✓ should contain text "Mar 25th" in timezone UTC -2 (1205 ms)
      ✓ should contain text "Mar 25th" in timezone UTC -3 (1223 ms)
      ✓ should contain text "Mar 25th" in timezone UTC -4 (1212 ms)
      ✓ should contain text "Mar 25th" in timezone UTC -5 (1320 ms)
      ✓ should contain text "Mar 25th" in timezone UTC -6 (1208 ms)
      ✓ should contain text "Mar 25th" in timezone UTC -7 (1219 ms)
      ✓ should contain text "Mar 25th" in timezone UTC -8 (1210 ms)
      ✓ should contain text "Mar 25th" in timezone UTC -9 (1206 ms)
      ✓ should contain text "Mar 25th" in timezone UTC -10 (1413 ms)
      ✓ should contain text "Mar 25th" in timezone UTC -11 (1209 ms)
    Changed port
      ✓ should return TestEvents (1313 ms)
    Basic auth
      ✓ should return TestEvents (1212 ms)
    Basic auth by default
      ✓ should return TestEvents (1428 ms)
    Basic auth backward compatibility configuration: DEPRECATED
      ✓ should return TestEvents (1217 ms)
    Fail Basic auth
      ✓ should show Unauthorized error (1221 ms)

  ● Calendar module › FullDayEvent over several days should show how many days are left from the from the starting date on › should contain text 'Ends in' with the left days

    expect(received).resolves.toBe()

    Received promise rejected instead of resolved
    Rejected to value: [Error: expect(received).toContain(expected) // indexOf·
    Expected substring: "Ends in"
    Received string:    "Today"]

       97 |
       98 |             it("should contain text 'Ends in' with the left days", async () => {
    >  99 |                     await expect(testTextContain(".calendar .today .time", "Ends in")).resolves.toBe(true);
          |                           ^
      100 |                     await expect(testTextContain(".calendar .yesterday .time", "Today")).resolves.toBe(true);
      101 |                     await expect(testTextContain(".calendar .tomorrow .time", "Tomorrow")).resolves.toBe(true);
      102 |             });

      at expect (node_modules/expect/build/index.js:113:15)
      at Object.expect (tests/e2e/modules/calendar_spec.js:99:10)

  ● Calendar module › FullDayEvent over several days should show how many days are left from the from the starting date on › should contain in total three events

    expect(received).resolves.toBe()

    Received promise rejected instead of resolved
    Rejected to value: [Error: expect(received).toHaveLength(expected)·
    Expected length: 3
    Received length: 4
    Received object: [<tr class="event-wrapper normal event yesterday"><td class="symbol align-right "><span class="fas fa-fw fa-calendar-alt" /></td><td class="title bright ">2 day events</td><td class="time light ">Ends in a day</td></tr>, <tr class="event-wrapper normal event today" style="opacity: 1;"><td class="symbol align-right "><span class="fas fa-fw fa-calendar-alt" /></td><td class="title bright ">2 day events</td><td class="time light ">Today</td></tr>, <tr class="event-wrapper normal event tomorrow" style="opacity: 0.6666666666666667;"><td class="symbol align-right "><span class="fas fa-fw fa-calendar-alt" /></td><td class="title bright ">2 day events</td><td class="time light ">Tomorrow</td></tr>, <tr class="event-wrapper normal event dayAfterTomorrow" style="opacity: 0.33333333333333337;"><td class="symbol align-right "><span class="fas fa-fw fa-calendar-alt" /></td><td class="title bright ">2 day events</td><td class="time light ">Monday</td></tr>]]

      102 |             });
      103 |             it("should contain in total three events", async () => {
    > 104 |                     await expect(testElementLength(".calendar .event", 3)).resolves.toBe(true);
          |                           ^
      105 |             });
      106 |     });
      107 |

      at expect (node_modules/expect/build/index.js:113:15)
      at Object.expect (tests/e2e/modules/calendar_spec.js:104:10)

  ● Calendar module › FullDayEvent Single day, should show Today › should contain in total two events

    expect(received).resolves.toBe()

    Received promise rejected instead of resolved
    Rejected to value: [Error: expect(received).toHaveLength(expected)·
    Expected length: 2
    Received length: 4
    Received object: [<tr class="event-wrapper normal event yesterday"><td class="symbol align-right "><span class="fas fa-fw fa-calendar-alt" /></td><td class="title bright ">daily full days</td><td class="time light ">Today</td></tr>, <tr class="event-wrapper normal event today" style="opacity: 1;"><td class="symbol align-right "><span class="fas fa-fw fa-calendar-alt" /></td><td class="title bright ">daily full days</td><td class="time light ">Today</td></tr>, <tr class="event-wrapper normal event tomorrow" style="opacity: 0.6666666666666667;"><td class="symbol align-right "><span class="fas fa-fw fa-calendar-alt" /></td><td class="title bright ">daily full days</td><td class="time light ">Tomorrow</td></tr>, <tr class="event-wrapper normal event dayAfterTomorrow" style="opacity: 0.33333333333333337;"><td class="symbol align-right "><span class="fas fa-fw fa-calendar-alt" /></td><td class="title bright ">daily full days</td><td class="time light ">Monday</td></tr>]]

      116 |             });
      117 |             it("should contain in total two events", async () => {
    > 118 |                     await expect(testElementLength(".calendar .event", 2)).resolves.toBe(true);
          |                           ^
      119 |             });
      120 |     });
      121 |

      at expect (node_modules/expect/build/index.js:113:15)
      at Object.expect (tests/e2e/modules/calendar_spec.js:118:10)

@sdetweil
Copy link
Collaborator

that the electron tests, right? I didnt run e2e

@sdetweil
Copy link
Collaborator

sdetweil commented Oct 11, 2024

you DID npm install to get the updated node-ical, right? I have a short term github link to my fork of that

@sdetweil
Copy link
Collaborator

sdetweil commented Oct 11, 2024

i'll go over the e2e tests.. only ran electron due to the date constraints
thanks

@khassel
Copy link
Collaborator Author

khassel commented Oct 12, 2024

these tests errored:

tests/unit/modules/default/calendar/calendar_fetcher_utils_bad_rrule.js
tests/electron/modules/calendar_spec.js
tests/e2e/modules/calendar_spec.js

you DID npm install to get the updated node-ical, right?

sure, used this:

services:
  magicmirror:
    image: registry.gitlab.com/khassel/magicmirror:develop_debug22
    ports:
      - "8080:8080"
    stdin_open: true
    tty: true
    command:
      - /bin/bash
      - -c
      - |
        # comment out if needed:
        rm -rf ./*
        rm -rf ./.*
        git clone -b fixcaldates https://github.com/sdetweil/MagicMirror.git .
        npm install
        mv config/config.js.sample config/config.js
        sed -i 's|address:.*|address: "0.0.0.0",|g;s|ipWhitelist:.*|ipWhitelist: [],|g' config/config.js
        touch ${MM_CUSTOMCSS_FILE:-"css/custom.css"}
        Xvfb :99 -screen 0 1024x768x16 &
        export DISPLAY=:99
        /bin/bash

@sdetweil
Copy link
Collaborator

thx..

new branch

here is an updated test version of the fixes for all kinds of calendar date problems.

NOTE: the changed branch name
NOTE: this used the node-cal@0.19.0 library UNCHANGED

best to make a new folder and git clone there

git clone https://github.com/sdetweil/MagicMirror
cd MagicMirror
git checkout fixcaldates2 // <------ note this is a changed branch name
npm run install-mm
copy your config.js and custom.css from the prior folder
and the non-default modules you have installed…

this ONLY changes the default calendar
but DOES ship an updated node-ical library too

if you need to fall back, just rename the folders around again so that
your original is called MagicMirror

all the testcases for node-ical and MagicMirror execute successfully.

the ‘BIG’ change here is to get the local NON-TZ dates for the
rrule.between()

all the checking and conversion code is commented out or not used
the node-ical fixes are for excluded dates (exdate) values being adjusted for DST/STD time… waiting to submit that PR

one fix in calendar.js for checking if a past date was too far back,
but it never checked to see IF the event date was in the past… (before today) so it chopped off too many

and one change in calendarfetcher.js to put out a better diagnostic message of the parsed data… (exdate was excluded cause JSON stringify couldn’t convert the complex structure)

I added the tests you all have documented

please re-pull and checkout the new branch (I deleted the old branch)
and npm run install-mm again

@sdetweil
Copy link
Collaborator

sdetweil commented Nov 1, 2024

node-ical version 0.20. posted to npm

will update pr next week when back home

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants