Skip to content

calcite-notice UnhandledError when running Vitest #12403

Open
@fnquinteros

Description

@fnquinteros

Check existing issues

Actual Behavior

Run test with Vitest + React Testing Library on a component that renders a calcite-notice with the open prop set to true.

The tests pass, but a message appears claiming an UnhandledError happened

Expected Behavior

Test pass without any unhandled errors.

Reproduction Sample

https://codesandbox.io/p/devbox/relaxed-ptolemy-hcmkzs

Reproduction Steps

  1. Open terminal
  2. Run npm test
  3. Check console output

Reproduction Version

latest

Relevant Info

TypeError: targetEl.getAnimations is not a function
 ❯ findAnimation node_modules/@esri/calcite-components/dist/chunks/dom.js:495:19
 ❯ whenTransitionOrAnimationDone node_modules/@esri/calcite-components/dist/chunks/dom.js:498:14
 ❯ whenTransitionDone node_modules/@esri/calcite-components/dist/chunks/dom.js:485:10
 ❯ node_modules/@esri/calcite-components/dist/chunks/openCloseComponent.js:13:5
 ❯ invokeTheCallbackFunction node_modules/jsdom/lib/jsdom/living/generated/Function.js:19:26
 ❯ runAnimationFrameCallbacks node_modules/jsdom/lib/jsdom/browser/Window.js:662:13
 ❯ Timeout._onTimeout node_modules/jsdom/lib/jsdom/browser/Window.js:640:11
 ❯ listOnTimeout node:internal/timers:581:17
 ❯ processTimers node:internal/timers:519:7

Regression?

No response

Priority impact

impact - p1 - need for current milestone

Impact

We're migrating from webpack + jest to Vite + Vitest and this test is making the CI fail, so we can't merge the migration PR.

Calcite package

  • @esri/calcite-components
  • @esri/calcite-components-react
  • @esri/calcite-design-tokens
  • @esri/calcite-ui-icons
  • @esri/eslint-plugin-calcite-components

Esri team

ArcGIS Urban

Metadata

Metadata

Assignees

No one assigned

    Labels

    0 - newNew issues that need assignment.ArcGIS UrbanIssues logged by ArcGIS Urban team members.bugBug reports for broken functionality. Issues should include a reproduction of the bug.impact - p1 - need for current milestoneUser set priority impact status of p1 - need for current milestoneneeds triagePlanning workflow - pending design/dev review.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions