We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
await user.click()
https://codesandbox.io/s/intelligent-maria-lqp7d9?file=/src/Button.test.tsx
In codesandbox just switch to the 'Tests' tab.
Based on the example in the docs (https://testing-library.com/docs/user-event/intro/) I expected this will make the test pass:
await user.click(screen.getByRole('button'))
The test fails.
In both cases solved by:
await waitFor(() => user.click(screen.getByRole('button')))
So either the docs are right and there's a bug or the docs are wrong.
14.4.3
No response
This is just the tip of my frustration iceberg following the upgrade to @TL/react 13 + @TL/user-event 14 See my comment here: testing-library/react-testing-library#1061 (comment)
The text was updated successfully, but these errors were encountered:
In Codesandbox the document in the test is not globalThis.document. You need to call userEvent.setup({document}) inside the test. https://codesandbox.io/s/userevent-react-vbcvs?file=/src/testEnv.js https://testing-library.com/docs/user-event/options/#document
document
test
globalThis.document
userEvent.setup({document})
For the timeout issue in jest: If you use fake timers, see https://testing-library.com/docs/user-event/options/#advancetimers .
Sorry, something went wrong.
The difference with CSB is because of being run in an iframe? Good to know!
And I indeed useFakeTimers - thank you for helping! 🙏
useFakeTimers
No branches or pull requests
Reproduction example
https://codesandbox.io/s/intelligent-maria-lqp7d9?file=/src/Button.test.tsx
Prerequisites
In codesandbox just switch to the 'Tests' tab.
Expected behavior
Based on the example in the docs (https://testing-library.com/docs/user-event/intro/)
I expected this will make the test pass:
Actual behavior
The test fails.
In both cases solved by:
So either the docs are right and there's a bug or the docs are wrong.
User-event version
14.4.3
Environment
No response
Additional context
This is just the tip of my frustration iceberg following the upgrade to @TL/react 13 + @TL/user-event 14
See my comment here: testing-library/react-testing-library#1061 (comment)
The text was updated successfully, but these errors were encountered: