Menu: Fix flaky keyboard focus test#78162
Conversation
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
|
Size Change: 0 B Total Size: 7.93 MB ℹ️ View Unchanged
|
|
Flaky tests detected in 152b756. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/25672026343
|
ciampo
left a comment
There was a problem hiding this comment.
I'd expect that using @ariakit/test to simulate user interaction would handle this automatically, but hopefully this fixes the flakiness 🤞
LGTM 🚀
|
@mirka I just a got a unit test failure in this PR run: https://github.com/WordPress/gutenberg/actions/runs/25787106519/job/75743092320?pr=78193 This Or is it something else? |
What?
Updates a flaky
Menuunit test so the Space-key interaction is simulated as a keyboard-triggered click.Why?
Recent CI failures show the menu opening, but focus sometimes stays on the menu container instead of moving to the first menu item. Ariakit uses the click event's
detailvalue to distinguish keyboard activation from pointer activation, so the test should make that path explicit.How?
Passes the trigger element to
press.Spaceand setsdetail: 0, matching browser keyboard activation behavior.Testing Instructions
npm run test:unit packages/components/src/menu/test/index.tsx -- --runInBand.