-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
test(ui): Convert DropdownLink tests to RTL and TS #39322
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
Conversation
}); | ||
|
||
it('does not close when document is clicked', function () { | ||
jest.useFakeTimers(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would it be fine if instead of using jest.useFakeTimers
and jest.runAllTimers()
, we would just wait for the element by using await screen.find*
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We still want to use jest.useFakeTimers()
so the test can finish as fast as possible, but I just learned that the async utilities do advance fake timers which is great: testing-library/dom-testing-library#661
So I kept the fake timers and removed all the runAllTimers()
calls
No description provided.