-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Formik + React Testing Library => ReferenceError: HTMLButtonElement is not defined #154
Comments
Do you mean |
@kentcdodds Ah yes sorry, let me update it. |
Hey, can you upload your components too? Also, did you try upgrading RTL to the latest version? |
@RoyGil Hi there, thanks for checking this out, this is the issue for me:
|
I can't reproduce this issue in a simple environment (https://codesandbox.io/s/x9o9xk15oq) which indicates that this is probably not an issue with the library, will close this. Thanks for your patience! |
<!-- Thanks for your interest in the project. Bugs filed and PRs submitted are appreciated! Please make sure that you are familiar with and follow the Code of Conduct for this project (found in the CODE_OF_CONDUCT.md file). Also, please make sure you're familiar with and follow the instructions in the contributing guidelines (found in the CONTRIBUTING.md file). If you're new to contributing to open source projects, you might find this free video course helpful: http://kcd.im/pull-request Please fill out the information below to expedite the review and (hopefully) merge of your pull request! --> <!-- What changes are being made? (What feature/bug is being fixed here?) --> **What**: Vague documentation (issue testing-library#153 ) <!-- Why are these changes necessary? --> **Why**: To clarify usage to users <!-- How were these changes implemented? --> **How**: Added documentation <!-- Have you done all of these things? --> **Checklist**: <!-- add "N/A" to the end of each line that's irrelevant to your changes --> <!-- to check an item, place an "x" in the box like so: "- [x] Documentation" --> - [x] Documentation N/A - [ ] Tests N/A - [x] Ready to be merged <!-- In your opinion, is this ready to be merged as soon as it's reviewed? --> - [ ] Added myself to contributors table <!-- this is optional, see the contributing guidelines for instructions --> <!-- feel free to add additional comments -->
I also ran into this issue and for those who stumble upon this I'd like to give them a heads up. So I was using mocha, assuming clodal was also using mocha due to that 'step' he is using in the example. He couldn't reproduce in the sandbox due to the environment being jest meaning it has jsdom built into it so formik ended up using the global
|
react-testing-library
version:3.0.2
formik
version:1.0.2
react
version:16.3.1
node
version:8.9.0
yarn
version:1.7.0
Relevant code or config:
What you did:
Wrote unit tests for a post form
What happened:
Unit test fails with error related to html element not found
Problem description:
Even though RTL seems to have found the html element, it seems like the element is missing on submit.
It's weird because i am able to log the element out but the error keeps happening.
I have tried to upgrade to RTL v4, using
fireEvent.simulatefireEvent.change to no avail as well.Suggested solution:
Could this be related to issue here: https://spectrum.chat/thread/2062f0a2-f137-4c94-b911-4b98f4703876? Not sure
Thanks!
The text was updated successfully, but these errors were encountered: