mozilla / mozilla/pontoon

Fix EntitiesList.test.js to properly work with vitest

Open Beginner friendly
#3,883 4 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

P3
Dominant language
Python
Stars
1.7k
Forks
611
Avg merge
1d 19h
Merged PRs (30d)
49

Description

The EntitiesList test when ran with npx vitest run EntitiesList.test.js throws below given error. As mentioned by @eemeli in PR 3880 comment rather than hacking way around we should disable this test suite until we upgrade react which should in theory solve this import issue or enable us to upgrading react-intersection-observer to latest which requires react^17.0.0 || ^18.0.0 || ^19.0.0".

src/modules/entitieslist/components/EntitiesList.test.js [ src/modules/entitieslist/components/EntitiesList.test.js ]
Error: Cannot find module '/Users/nishit/Development/pontoon/node_modules/react-dom/test-utils' imported from /Users/nishit/Development/pontoon/node_modules/react-intersection-observer/dist/test-utils.mjs
Did you mean to import "react-dom/test-utils.js"?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with src/modules/entitieslist/components/EntitiesList.test.js and run npx vitest run EntitiesList.test.js to reproduce the react-dom/test-utils import error from react-intersection-observer. Review PR 3880's comment and the current test setup, then disable this test suite as described until the React dependency can be upgraded. Done means the Vitest run no longer fails on this suite.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react
Domain
frontend, testing-qa
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
65/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.