Closed LuisBarroso37 closed 3 years ago
Thanks for the feedback.
Please provide a CodeSandbox or a link to a repository on GitHub. Otherwise these types of issues are incredibly hard for us to debug.
Here are some tips for providing a minimal example: https://stackoverflow.com/help/mcve
@eps1lon I tried to recreate it as best as I could. I had to do some changes to make it work on CodeSandbox.
Here is the link: https://codesandbox.io/s/create-react-app-typescript-forked-9z498?file=/src/UsersTable.test.tsx
If the problem is screen.findByText()
then it is not jest-dom. Maybe we should move this to @testing-library/dom-testing-library
? Let me know and I can do it.
@eps1lon, @gnapse,
Is the CodeSandbox enough? Are you able to figure out what the issue is?
@testing-library/jest-dom
version: 5.11.9msw
version: 0.28.2node
version: 14.17.1react-testing-library
version: 11.2.5@material-ui/core
: 4.11.3,@material-ui/data-grid
: 4.0.0-alpha.19Relevant code or config:
What happened:
This is the error message:
Problem description:
I expected
screen
to find the fetched data in the DataGrid component but it does not. I have written other very similar tests with the same setup and they all pass so I do not understand why this one does not.I console logged the response that I get back from the mocked axios call and I see the data. I know that the state is being updated but for some reason
screen.findByText()
does not find it.Can you help me figure out why this is happening?