-
Notifications
You must be signed in to change notification settings - Fork 1.1k
fireEvent.change not calling mock function #264
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
Comments
For react to actually call your callback function, the change event has to change the value somehow, so try this: fireEvent.change(input, {target: {value: '2'}}); |
If you have further questions, please ask on the official support channel: https://spectrum.chat/react-testing-library |
That works - thanks for the quick support. You're the man! |
lucbpz
pushed a commit
to lucbpz/react-testing-library
that referenced
this issue
Jul 26, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
react-testing-library
version: 5.4.4react
version: 16.3.2node
version: 10.14.2npm
(oryarn
) version: 1.13.0Relevant code or config:
Here is my tree structure for the related element:
What you did:
yarn jest --watchAll
What happened:
Expected: 1
Received: 0
Problem description:
This should have called my mock function on change.
Suggested solution:
I haven't got one yet - but I will be working towards a solution.
The text was updated successfully, but these errors were encountered: