Skip to content
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

E2E: Add test coverage for Navigation block fallback behavior #69137

Open
wants to merge 1 commit into
base: trunk
Choose a base branch
from

Conversation

himanshupathak95
Copy link
Contributor

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.js file:

  • Tests that the block falls back to a Page List when no menus exist
  • Tests that the block uses the first non-empty menu as a fallback

Testing Instructions

  • Run
npm run test:e2e -- editor/blocks/navigation.spec.js
  • Verify that all tests pass

To manually verify the behavior:

  • Create a new post
  • Insert a Navigation block with no menus present - should show Page List
  • Create a menu with content and insert a Navigation block - should show menu-content

Copy link

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 props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: himanshupathak95 <abcd95@git.wordpress.org>
Co-authored-by: getdave <get_dave@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@t-hamano t-hamano added [Type] Code Quality Issues or PRs that relate to code quality [Block] Navigation Affects the Navigation Block [Type] Automated Testing Testing infrastructure changes impacting the execution of end-to-end (E2E) and/or unit tests. and removed [Type] Code Quality Issues or PRs that relate to code quality labels Feb 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Navigation Affects the Navigation Block [Type] Automated Testing Testing infrastructure changes impacting the execution of end-to-end (E2E) and/or unit tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add e2e test to cover Nav block front end fallbacks
2 participants