-
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
Add test for useConstrainedTabbing #48736
base: trunk
Are you sure you want to change the base?
Conversation
Note: in the next days I won't be able to do any work on this. If anyone has time and passion for testing, please do feel free to go ahead and make this PR yours. ❤️ |
Size Change: +881 B (0%) Total Size: 1.34 MB
ℹ️ View Unchanged
|
Flaky tests detected in 5873b77. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/4499234811
|
08e90b0
to
3265482
Compare
I'm having some troubles to test this and would greatly appreciate some help. Cc @ellatrix To my understanding, due to the particular implementation of
The above logic appears to be a bit hard to test. To my understanding it's in part a timing issue and in part because of the way the React testing library
I'm not that familiar with the React testing library and I'm out of ideas. Not sure how to make these tests work. Any help is very welcome. On a related note, i'd like to stress the importance of testing |
I would need some help to check if the current code is actually testable. @Mamaduka not sure if you have some time but I'd greatly appreciate your help, is possible 🙏 See my last comment: #48736 (comment) If the current implementation of |
Thanks for the ping, @afercia! I am adding this to my todo list and will try to provide feedback at the end of this week or early next. |
Fixes #47427
What?
This PR seeks to add tests for
useConstrainedTabbing
.For now, it's a draft as I'm unclear how to solve some issues. I'd greatly appreciate any jelp and feedback. Cc @ellatrix
event.keycode
so I had to change the hook to useevent.code
.trap
element is focused and then blurred, the actual focus goes to the first tabbable element within the node.Why?
Right now, there's no unit tests for
useConstrainedTabbing
. Such an important component should have at least some basic tests.How?
Add tests.
Testing Instructions
Run the test:
npm run test:unit -- --testPathPattern packages/compose/src/hooks/use-constrained-tabbing/test/index.js
Testing Instructions for Keyboard
Screenshots or screencast