react-testing-library
react-testing-library copied to clipboard
🐐 Simple and complete React DOM testing utilities that encourage good testing practices.
In our app we use Mantine which has a LOT of transitions. We suppress all transitions by setting their duration to 0 in tests, so that we don't have to...
Closes https://github.com/testing-library/react-testing-library/issues/1184 Docs: https://github.com/testing-library/testing-library-docs/pull/1384 **BREAKING CHANGE**: `@testing-library/dom` was moved to a peer dependency and needs to be explicitly installed. This reduces the chance of having conflicting versions of `@testing-library/dom` installed...
- `@testing-library/react` version: 14.2.2 - Testing Framework and version: jest, 29.7 - DOM Environment: "jest-environment-jsdom": "29.7.0" ### Relevant code or config: ```js const {user} = setup(); const input = screen.getByRole('textbox');...
### Describe the feature you'd like: Happy to give this a try myself! I've found myself repeating the same pattern of typecasting elements returned from queries when using `render` when...
Following the React change, we should also add support for onCaughtError and onUncaughtError. More details [here](https://github.com/reactjs/react.dev/pull/6742) FYI - @eps1lon
- @testing-library/react version: 14.2.2 - Testing Framework and version: jest 29.4.1 - DOM Environment: jest-environment-jsdom 29.4.1 - node: 20.11.1 - react: 18.2.0 ### Relevant code or config: https://github.com/R-J-dev/example-error-render-issue/blob/main/src/test-error/error-component.tsx error-component.tsx (just...
### Describe the feature you'd like: I would like to be able to test a re-render with a different wrapper. The use case is to ensure that returned callbacks of...
- `@testing-library/react` version: see below - Testing Framework and version: N/A - DOM Environment: ### Relevant code or config: ```json { "dependencies": { "@testing-library/react": "^15.0.6", "typescript": "^5.4.5" } } ```...
- `@testing-library/react` version: `14.3.1` + `15.0.7` - Testing Framework and version: ```json { "devDependencies": { "@testing-library/react": "15.0.7" "jest": "29.7.0", "jest-environment-jsdom": "29.7.0", "react": "18.3.1" } } ``` ### Relevant code or...
We've discovered that when using latest versions of Vitest, RTL, and userEvent the userEvent APIs are not patched with act() and this results in "not wrapped in act()" warnings. ```...