Fix navigation block unit test and e2e test#76692
Conversation
1efb3cd to
a609fcc
Compare
|
The failing E2E test should not be related to this PR. See #76643 (comment) for more details. |
|
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. |
.github/workflows/unit-test.yml
Outdated
| # TODO: Revert this change before merging. | ||
| # - event: 'pull_request' | ||
| # wordpress: 'previous major version' |
There was a problem hiding this comment.
Caution
Note: Before merging this PR, revert this temporary change.
There was a problem hiding this comment.
I'm not sure why GitHub doesn't visualize the changes, but changes definitely exist.
git diff trunk fix/navigation-unit-test-previous-wp-version -- test/e2e/specs/editor/plugins/block-hooks.spec.js
diff --git a/test/e2e/specs/editor/plugins/block-hooks.spec.js b/test/e2e/specs/editor/plugins/block-hooks.spec.js
index f56a1513f4d..249be208ae5 100644
--- a/test/e2e/specs/editor/plugins/block-hooks.spec.js
+++ b/test/e2e/specs/editor/plugins/block-hooks.spec.js
@@ -346,7 +346,7 @@ test.describe( 'Block Hooks API', () => {
page.locator( '.wp-block-navigation__container > *' )
).toHaveClass( [
'wp-block-navigation-item wp-block-home-link',
- ' wp-block-navigation-item wp-block-navigation-link',
+ 'wp-block-navigation-item wp-block-navigation-link',
'wp-block-page-list',
] );
} );
@@ -424,7 +424,7 @@ test.describe( 'Block Hooks API', () => {
await expect(
page.locator( '.wp-block-navigation__container > *' )
).toHaveClass( [
- ' wp-block-navigation-item wp-block-navigation-link',
+ 'wp-block-navigation-item wp-block-navigation-link',
'wp-block-navigation-item wp-block-home-link',
'wp-block-page-list',
] );This space should have been removed in #76685.
|
Size Change: 0 B Total Size: 7.66 MB ℹ️ View Unchanged
|
ingeniumed
left a comment
There was a problem hiding this comment.
Running into this on #76704. Thanks for resolving it 🙏🏾
|
For the failing collaboration e2e tests, you can pull in the fix I have - fdb66e9. That'll resolve all the e2e tests in this PR in one go 🙏🏾 |
|
Now that #76704 has been merged and I’ve merged trunk into this branch, all CI checks should be passing. |
|
Flaky tests detected in bbbde4e. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/23326961214
|
|
I just cherry-picked this PR to the wp/7.0 branch to get it included in the next release: 29d7db9 |
* Fix navigation block rendering unit test (second try) * Fix e2e test * Revert unncessary change
|
Thanks @t-hamano! |
This updates the pinned hash from the `gutenberg` from `487a096a9782ba6110a7686d7b4b2d0c55ed1b06` to `2ee7ede6be6d4e55d5c7047394c5c4e0ea8d521d`. The following changes are included: - RTC: Backport race condition fix (WordPress/gutenberg#76649) - Fix navigation block rendering unit test (WordPress/gutenberg#76685) - Hide Additional CSS controls when block is inside contentOnly editing mode (WordPress/gutenberg#76512) - RTC: Increase polling intervals, increase polling on primary room only (WordPress/gutenberg#76704) - Navigation: Avoid List View changing position when navigation block saves (WordPress/gutenberg#76659) - Fix navigation block unit test and e2e test (WordPress/gutenberg#76692) - Fix locked content when switching to a different template without exiting 'Edit pattern' (WordPress/gutenberg#76710) - Metabox: Fix checkbox style in sidebar (WordPress/gutenberg#76718) - Stop keeping stale controlled blocks after reset (WordPress/gutenberg#76591) - Gate client-side media processing as plugin-only (WordPress/gutenberg#76700) A full list of changes can be found on GitHub: https://github.com/WordPress/gutenberg/compare/487a096a9782ba6110a7686d7b4b2d0c55ed1b06…2ee7ede6be6d4e55d5c7047394c5c4e0ea8d521d. Log created with: git log --reverse --format="- %s" 487a096a9782ba6110a7686d7b4b2d0c55ed1b06..2ee7ede6be6d4e55d5c7047394c5c4e0ea8d521d | sed 's|#\([0-9][0-9]*\)|https://github.com/WordPress/gutenberg/pull/\1|g; /github\.com\/WordPress\/gutenberg\/pull/!d' | pbcopy See #64595. git-svn-id: https://develop.svn.wordpress.org/trunk@62076 602fd350-edb4-49c9-b593-d223f7449a82
This updates the pinned hash from the `gutenberg` from `487a096a9782ba6110a7686d7b4b2d0c55ed1b06` to `2ee7ede6be6d4e55d5c7047394c5c4e0ea8d521d`. The following changes are included: - RTC: Backport race condition fix (WordPress/gutenberg#76649) - Fix navigation block rendering unit test (WordPress/gutenberg#76685) - Hide Additional CSS controls when block is inside contentOnly editing mode (WordPress/gutenberg#76512) - RTC: Increase polling intervals, increase polling on primary room only (WordPress/gutenberg#76704) - Navigation: Avoid List View changing position when navigation block saves (WordPress/gutenberg#76659) - Fix navigation block unit test and e2e test (WordPress/gutenberg#76692) - Fix locked content when switching to a different template without exiting 'Edit pattern' (WordPress/gutenberg#76710) - Metabox: Fix checkbox style in sidebar (WordPress/gutenberg#76718) - Stop keeping stale controlled blocks after reset (WordPress/gutenberg#76591) - Gate client-side media processing as plugin-only (WordPress/gutenberg#76700) A full list of changes can be found on GitHub: https://github.com/WordPress/gutenberg/compare/487a096a9782ba6110a7686d7b4b2d0c55ed1b06…2ee7ede6be6d4e55d5c7047394c5c4e0ea8d521d. Log created with: git log --reverse --format="- %s" 487a096a9782ba6110a7686d7b4b2d0c55ed1b06..2ee7ede6be6d4e55d5c7047394c5c4e0ea8d521d | sed 's|#\([0-9][0-9]*\)|https://github.com/WordPress/gutenberg/pull/\1|g; /github\.com\/WordPress\/gutenberg\/pull/!d' | pbcopy See #64595. Built from https://develop.svn.wordpress.org/trunk@62076 git-svn-id: http://core.svn.wordpress.org/trunk@61358 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Follow-up on #76685
What?
Changeset 62068 improved the behavior of
get_block_wrapper_attributes()by trimming unnecessary whitespace and semicolon. Following this new behavior, we corrected the unit test expected value in #76685.However, this causes the tests to fail because the trunk branch runs unit tests on the older WP version as well as the latest WP version. Therefore, this PR adds
is_wp_version_compatible('7.0')check to refer to the previous expectations for WP 6.9 and earlier.Testing Instructions
All CI checks should be green.
Use of AI Tools
None