MagicMirror icon indicating copy to clipboard operation
MagicMirror copied to clipboard

one calendar test fails since today

Open khassel opened this issue 2 years ago • 7 comments

  ● Calendar module › exdate check › should show the recurring event 51 times (excluded once) in a 364-day (inclusive) period

    expect(received).resolves.toBe()

    Received promise rejected instead of resolved
    Rejected to value: [Error: expect(received).toHaveLength(expected)·
    Expected length: 51
    Received length: 50
    Received object: [<tr class="event-wrapper normal event"><td class="symbol align-right "><span class="fas fa-fw fa-calendar-alt" /></td><td class="title bright ">My Event</td><td class="time light ">Dec 20th</td></tr>, <tr class="event-wrapper normal event"><td class="symbol align-right "><span class="fas fa-fw fa-calendar-alt" /></td><td class="title bright ">My Event</td><td class="time light ">Dec 27th</td></tr>, <tr class="event-wrapper normal event"><td class="symbol align-right "><span class="fas fa-fw fa-calendar-alt" /></td><td class="title bright ">My Event</td><td class="time light ">Jan 3rd</td></tr>, <tr class="event-wrapper normal event"><td class="symbol align-right "><span class="fas fa-fw fa-calendar-alt" /></td><td class="title bright ">My Event</td><td class="time light ">Jan 10th</td></tr>, <tr class="event-wrapper normal event"><td class="symbol align-right "><span class="fas fa-fw fa-calendar-alt" /></td><td class="title bright ">My Event</td><td class="time light ">Jan 17th</td></tr>, <tr class="event-wrapper normal event"><td class="symbol align-right "><span class="fas fa-fw fa-calendar-alt" /></td><td class="title bright ">My Event</td><td class="time light ">Jan 24th</td></tr>, <tr class="event-wrapper normal event"><td class="symbol align-right "><span class="fas fa-fw fa-calendar-alt" /></td><td class="title bright ">My Event</td><td class="time light ">Jan 31st</td></tr>, <tr class="event-wrapper normal event"><td class="symbol align-right "><span class="fas fa-fw fa-calendar-alt" /></td><td class="title bright ">My Event</td><td class="time light ">Feb 7th</td></tr>, <tr class="event-wrapper normal event"><td class="symbol align-right "><span class="fas fa-fw fa-calendar-alt" /></td><td class="title bright ">My Event</td><td class="time light ">Feb 14th</td></tr>, <tr class="event-wrapper normal event"><td class="symbol align-right "><span class="fas fa-fw fa-calendar-alt" /></td><td class="title bright ">My Event</td><td class="time light ">Feb 21st</td></tr>, …]]

       95 |
       96 |             it("should show the recurring event 51 times (excluded once) in a 364-day (inclusive) period", async () => {
    >  97 |                     await expect(testElementLength(".calendar .event", 51)).resolves.toBe(true);
          |                           ^
       98 |             });
       99 |     });
      100 |

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

I was able to fake the date in my test container:

  • running with a date before today: test succeeds
  • running with a date of today or later: test fails

I think this has something to do with the data used in tests/mocks/calendar_test_exdate.ics.

So I think we should remove the test until someone has an idea to fix it.

khassel avatar Dec 13 '23 21:12 khassel

maybe the original author @jkriegshauser can help us out witrh a fix?

rejas avatar Dec 14 '23 06:12 rejas

@rejas I'll try to take a look when i get some time. I've noticed issues since Los_Angeles timezone went off DST. I still highly suspect the rrule js module since there are hacks around making it work.

jkriegshauser avatar Dec 15 '23 17:12 jkriegshauser

Digging into this it seems the test still depends on the timezone used.

With setting the timezone to UTC before running the tests it seems to work. Will provide a PR and we will see if this fix is sufficent.

khassel avatar Dec 15 '23 20:12 khassel

this test still fails sometimes, seems to be time dependent

FAIL tests/electron/modules/calendar_spec.js (12.048 s)
  ● Calendar module › Exdate check › should show the recurring event 51 times (excluded once) in a 364-day (inclusive) period

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

    Expected: 51
    Received: 50

      55 | 			expect(elem).not.toBeNull();
      56 | 			const cnt = await loc.count();
    > 57 | 			expect(cnt).toBe(51);
         | 			            ^
      58 | 		});
      59 | 	});
      60 | });

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

khassel avatar Jan 03 '24 21:01 khassel

Yep, something is still funky in the latest release. I had an event show up on MM today that was deleted (in exdate). I'll look into it

jkriegshauser avatar Jan 04 '24 01:01 jkriegshauser

I am not sure this is related, but it would seem to fit the failure. I am seeing two different recurring meetings where I have events listed for all future dates, but not the original date. For example, I have an event set to recur every 2nd Wednesday starting January 10th. I don't see it on the 10th, but I do see it on all subsequent 2nd Wednesdays through the rest of the year.

jc43081 avatar Jan 07 '24 18:01 jc43081

I think I know what it is. I’m looking into it.

On Sun, Jan 7, 2024 at 10:50 AM Jeff Cain @.***> wrote:

I am not sure this is related, but it would seem to fit the failure. I am seeing two different recurring meetings where I have events listed for all future dates, but not the original date. For example, I have an event set to recur every 2nd Wednesday starting January 10th. I don't see it on the 10th, but I do see it on all subsequent 2nd Wednesdays through the rest of the year.

— Reply to this email directly, view it on GitHub https://github.com/MagicMirrorOrg/MagicMirror/issues/3291#issuecomment-1880140302, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAM6MX5XAYFANNN6VPGXXVLYNLU5RAVCNFSM6AAAAABAT3PSJ6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQOBQGE2DAMZQGI . You are receiving this because you were mentioned.Message ID: @.***>

jkriegshauser avatar Jan 07 '24 19:01 jkriegshauser