-
Notifications
You must be signed in to change notification settings - Fork 4.7k
E2E: Add test coverage for Navigation block fallback behavior #69137
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
base: trunk
Are you sure you want to change the base?
E2E: Add test coverage for Navigation block fallback behavior #69137
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. |
74852b3 to
9106f32
Compare
|
Hi @t-hamano, I'd like you to please review this PR at your convenience and let me know if it meets your approval. Thanks. |
t-hamano
left a comment
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.
Thanks for the PR!
If I understand correctly, the fallback behavior is for the frontend, NOT for the editor. In the editor, the Navigation block should always be empty. Furthermore, some assumptions seem incorrect.
Let's take a deeper look at the description in #36740 and organize what and how to test:
Testing
- Open Site Editor.
- Remove any existing Nav block.
- Add Nav block from scratch. Don't add any items!
- Save your empty Nav block and publish the post.
- Go to front of site.
- See that the first of your Navigation Menus is rendered by default even though no Menu has been selected.
- Remove all of the items from the Navigation Post that is currently being used as the fallback - this should make it ineligible to be used as a fallback.
- Go to front of site. Check that a different Navigation Post is being used as a fallback.
- Remove all your Navigation Posts - that's right, ditch them all!
- Go to front of site. Check that it falls back to the Page List.
|
I looked into this issue again, but I didn't fully understand what the expected behavior of the fallback is in the frontend. It might be a good idea to discuss what kind of tests are needed before moving forward with this PR. |
What?
Closes #36825
Adds E2E test coverage for Navigation block fallback behavior, ensuring the navigation block falls back appropriately when no menus exist and uses the first non-empty menu as a fallback.
Why?
In #36740, functionality was added to provide fallback behavior for the Navigation block, determining what users see when there are no menus or when menus become unavailable. This PR adds dedicated test coverage to ensure this new fallback behavior remains stable and works as expected.
How?
Added two new E2E tests in the
navigation.spec.jsfile:Testing Instructions
To manually verify the behavior: