Fix flaky Menu space key unit test#77972
Conversation
|
Size Change: 0 B Total Size: 7.94 MB ℹ️ View Unchanged
|
|
Flaky tests detected in 7ad3ada. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/25392311640
|
|
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. |
|
Not 100% sure if this will work, but let's see 😄 |
What?
Fixes a flaky
Menuunit test by avoiding duplicate coverage of disabled item focus behavior in the Space-key trigger test.Why?
The recent CI failures all had the same shape: after pressing Space on the menu trigger, the menu opened but focus stayed on the menu container instead of moving to the disabled first menu item. The ArrowDown test already covers focusing disabled-but-accessible menu items, so the Space-key test can focus on whether Space opens the menu and moves focus to the first normal item.
How?
Updates the Space-key test fixture so its first menu item is not disabled, and removes the disabled-item-specific test comment from that case.
Testing Instructions
npm run test:unit packages/components/src/menu/test/index.tsx -- --runInBand.