-
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
Check nav is editable before counting items #24146
Conversation
Size Change: 0 B Total Size: 1.15 MB ℹ️ View Unchanged
|
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.
This makes sense. Since #23187 was merged there might still be an in-flight HTTP request for the menu items after the create button is clicked, which would result in the items not being created immediately.
I'm guessing that even though the endpoints are mocked things are still happening asynchronously.
With the changes in #23187 there's probably some code that can be removed as well. I don't think the button is ever disabled:
https://github.com/WordPress/gutenberg/blob/master/packages/e2e-tests/specs/experiments/navigation.test.js#L236-L243
020d2f7
to
b3ece1c
Compare
Oh, well spotted! Might remove that separately though. |
Description
Fixes #23876 (hopefully 😅) by checking that the Nav block is no longer in placeholder mode before counting its items. Given that the test fails because it doesn't find the items on the page, but in the very next check the same items are correctly rendered in a snapshot, I'm guessing it's a timing issue.
How has this been tested?
It's very hard to reproduce the issue locally, but I've managed to do so by running
THROTTLE_CPU=4 npm run test-e2e packages/e2e-tests/specs/experiments/navigation.test.js
. As it's an intermittent failure, it's hard to know for sure if this change has actually fixed the issue or not 😬Screenshots
Types of changes
Bug fix (non-breaking change which fixes an issue)
Checklist: