Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[Bug] one calendar unit test fails since today #3830

Copy link
Copy link

Description

@khassel
Issue body actions

Environment

MagicMirror² version: develop branch
Node version:
npm version:
Platform:

Which start option are you using?

node --run server

Are you using PM2?

No

Module

None

Have you tried disabling other modules?

  • Yes
  • No

Have you searched if someone else has already reported the issue on the forum or in the issues?

  • Yes

What did you do?

node@e8f736e24b5c:/opt/magic_mirror$ npx jest tests/unit/modules/default/calendar/calendar_fetcher_utils_spec.js
 FAIL   unit  tests/unit/modules/default/calendar/calendar_fetcher_utils_spec.js
  Calendar fetcher utils test
    filterEvents
      ✓ should return only ongoing and upcoming non full day events (46 ms)
      ✓ should return only ongoing and upcoming full day events (1 ms)
      ✕ should return the correct times when recurring events pass through daylight saving time (40 ms)
      ✓ should return the correct moments based on the timezone given (17 ms)

  ● Calendar fetcher utils test › filterEvents › should return the correct times when recurring events pass through daylight saving time

    TypeError: Cannot read properties of undefined (reading 'startDate')

      80 |                              .tz(moment.tz.guess()); // Convert to guessed timezone as that is used in the filterEvents
      81 |
    > 82 |                      let julyMoment = moment(`${moment(julyFirst[0].startDate, "x").format("YYYY")}-07-01T09:00:00`)
         |                                                                     ^
      83 |                              .tz("Europe/Amsterdam", true) // Convert to Europe/Amsterdam timezone (see event ical) but keep 9 o'clock
      84 |                              .tz(moment.tz.guess()); // Convert to guessed timezone as that is used in the filterEvents
      85 |

      at Object.startDate (tests/unit/modules/default/calendar/calendar_fetcher_utils_spec.js:82:51)

Test Suites: 1 failed, 1 total
Tests:       1 failed, 3 passed, 4 total
Snapshots:   0 total
Time:        0.721 s
Ran all test suites matching tests/unit/modules/default/calendar/calendar_fetcher_utils_spec.js.

What did you expect to happen?

test should pass

What actually happened?

test fails

Additional comments

No response

Participation

  • I am willing to submit a pull request for this change.
Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.