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

Replace react-test-renderer. #2136

Open
FrenjaminBanklin opened this issue Dec 10, 2024 · 0 comments
Open

Replace react-test-renderer. #2136

FrenjaminBanklin opened this issue Dec 10, 2024 · 0 comments
Assignees
Labels
chore Maintain a clean and strong character. dependencies Pull requests that update a dependency file high priority testing update change something to be something else

Comments

@FrenjaminBanklin
Copy link
Contributor

FrenjaminBanklin commented Dec 10, 2024

react-test-renderer has been deprecated - seeing as all of our unit tests are written using this (not counting those written using Enzyme, which we were already addressing with #2118), which means all of our unit tests will have to be rewritten using whatever the modern standard solution is.

This appears to be @testing-library/react.

Critically, our current approach to writing tests is to test implementation details - inspecting a rendered component's DOM tree and making sure there are certain things in certain locations with certain properties. This is apparently contrary to the industry-standard approach to writing tests, which is to test behavior details - using aria properties and finding elements according to their roles, etc.

Changing tests to fit the 'behavior' approach will be bad enough, but it appears as though we'll also need to update everything to a more recent version of React in the first place in order to support current versions of the modern testing libraries (see #2137).

@FrenjaminBanklin FrenjaminBanklin added testing update change something to be something else dependencies Pull requests that update a dependency file high priority chore Maintain a clean and strong character. labels Dec 10, 2024
@FrenjaminBanklin FrenjaminBanklin self-assigned this Dec 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Maintain a clean and strong character. dependencies Pull requests that update a dependency file high priority testing update change something to be something else
Projects
None yet
Development

No branches or pull requests

1 participant