-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Tooltip: improve tests #57345
Merged
Merged
Tooltip: improve tests #57345
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
e826e66
Remove unnecessary RegExp
ciampo 6ca3f5d
Use @ariakit/test instead of testing library
ciampo 6b5334f
Use sleep utility instead of custom promise
ciampo c97a986
Remove unnecessary import
ciampo 8292091
Add utility functions
ciampo 32b5703
Make multiple children test actually test what it's supposed to test
ciampo 8cd4033
Test for tooltip to hide when another element gets focus
ciampo 3894dca
Test for tooltip to hide when hovering outside the anchor
ciampo a6ca61f
Improve tooltip hiding on click test
ciampo 7674cb0
More utils refactor
ciampo 0c47cab
Improve test with disabled anchor
ciampo 18a228c
Wait for tooltip to be hidden in the hideOnClick={false} test
ciampo 5e590e3
Refactor custom delay test
ciampo 4fe91bc
Refactor "mouse leave early" test (skip as it's still not passing)
ciampo be278f8
Improve shortcut-related tests
ciampo 090e22b
Improve the Modal Escape test
ciampo b5aaf5a
Refactor description text test
ciampo cf1ea1a
Add second-level describes
ciampo 2d4692a
Improve TS expecte error message
ciampo 536ddeb
Add missing async/await in test utils
ciampo 636678f
Await for tooltip to appear in shortcut tests
ciampo 0e8c5e6
Apply delay prop only when showing the tooltip
ciampo 57b5335
Add skip timeout waiting time after each test
ciampo 21d2c0e
CHANGELOG
ciampo 89372ed
Apply review feedback
ciampo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -66,7 +66,7 @@ function Tooltip( props: TooltipProps ) { | |
|
||
const tooltipStore = Ariakit.useTooltipStore( { | ||
placement: computedPlacement, | ||
timeout: delay, | ||
showTimeout: delay, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looking at the |
||
} ); | ||
|
||
return ( | ||
|
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
@ariakit/test
keyboard events useevent.key
, so I had to add this check in order for theModal
component to react to those simulated user eventsThere 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 can implement
code
in@ariakit/test
. I'm just not sure how to transform keys into code, and I'd prefer to sidestep the need to maintain a full map of values.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.
I guess we can keep this change to the
Modal
component for now (cc @mirka )