Category "react-testing-library"

react-dom installed, but not found. `Could not find module in path: 'react-dom/client' relative to`

Here is the Codesandbox I want to run a rest, but the Tests tab shows this error. Could not find module in path: 'react-dom/client' relative to '/node_modules/@

React redux toolkit testing with jest, how to dispatch asyncthunk and the state?

I want to write unit test which checks if data (onLoad) from dispatching async thunk is delivered into state. It's first time when i'm writing unit tests and it

Simplest test for react-router's Link with @testing-library/react

I'm trying to understand how to best test that react-router behaves as expected with @testing-library/react. The simplest test I can think of, is to verify tha

How to test Material UI v5 components with sx props in @testing-library/react?

React Testing Library does not apply sx props of Material UI components during rendering. For example, I specify properties to hide an element at certain breakp

How to pass a an argument to getByText in react Testing Library?

Currently I'm doing this getByText(/SomeText/i); But I want to make a function and pass some text as an argument by first storing it in a variable. I tried doi

Webpack 5 & Jest - Property 'toBeInTheDocument' does not exist on type 'JestMatchers<HTMLElement>'

I can't get the typings for Jest to work with Webpack 5 and TypeScript, I've tried other solutions for the same problem. The problem is only with "screen" and "

Webpack 5 & Jest - Property 'toBeInTheDocument' does not exist on type 'JestMatchers<HTMLElement>'

I can't get the typings for Jest to work with Webpack 5 and TypeScript, I've tried other solutions for the same problem. The problem is only with "screen" and "