Questions about testing events with the user-event utility.
Questions tagged [user-event]
65 questions
0
votes
1 answer
testing library user event is one step behind
I have a form with two inputs. one is textbox the other one is material ui autocomplete.
I am using Yup to validate them. If any of them is empty then error text appears. They are empty as default. In initial render there are two errors expectedly.…

Burak Gündüz
- 466
- 5
- 11
0
votes
1 answer
React doesn't rerender on state change while testing
I am testing a react component which has a simple Material-ui switch that updates a boolean field. The component works without any issues when I run the app locally.
In my test, I am mocking the graphql calls via MockedProvider. The mocked provider…

ege
- 812
- 6
- 16
0
votes
1 answer
"INCORRECT_JSON_FORMAT userEvent" error in a Recommendations AI project
Does anyone have an idea what this error could mean?
error screenshot

Vasyl Kosteniuk
- 15
- 2
0
votes
1 answer
Error using userEvent with React Testing Library and react-select AsyncSelect (but only in CodeSandbox?)
I created this CodeSandbox so I could demonstrate a problem with related code (the onChange not firing in a test):
https://codesandbox.io/s/festive-tree-xkw8s?file=/src/App.test.js
However in CodeSandbox I can't even get that far because as soon as…

Mark Fraser
- 3,160
- 2
- 29
- 48
-2
votes
1 answer
testing-library/user-event - how to handle `act(...)` warnings related to material-ui's animations?
I understand that I'm not supposed to add act() around user events because the testing library does it for me, but I get warnings if I don't. Specifically, for example given a MUI component with the ripple effect, here's what I find:
import { Tab…

emragins
- 4,607
- 2
- 33
- 48