-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Components: Try fixing some flaky Composite
and Tabs
tests
#58968
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. |
@@ -275,7 +275,7 @@ describe.each( [ | |||
const { item2 } = getOneDimensionalItems(); | |||
|
|||
await press.Tab(); | |||
expect( item2 ).toHaveFocus(); | |||
await waitFor( () => expect( item2 ).toHaveFocus() ); |
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.
Perhaps some sleep()
before the Tab()
(as suggested here) would be a good improvement too?
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.
Yes, that might help. The Tabs test was fine, but I could still get this Composite one to flake.
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.
Done in 1eb47f2
@@ -275,7 +275,7 @@ describe.each( [ | |||
const { item2 } = getOneDimensionalItems(); | |||
|
|||
await press.Tab(); | |||
expect( item2 ).toHaveFocus(); | |||
await waitFor( () => expect( item2 ).toHaveFocus() ); |
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.
Yes, that might help. The Tabs test was fine, but I could still get this Composite one to flake.
e3176eb
to
1eb47f2
Compare
Flaky tests detected in 1eb47f2. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/7900653318
|
Another flaky test failure on |
What?
This PR adds some flexibility to a few
Composite
andTabs
tests.Why?
To reduce the test flakiness.
How?
We're adding some wait time before checking focus right after tabbing.
Testing Instructions
Verify all tests pass.
Testing Instructions for Keyboard
None
Screenshots or screencast
None