-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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 Tests: Add Block Hooks Test Coverage #69044
base: trunk
Are you sure you want to change the base?
Conversation
Size Change: 0 B Total Size: 1.84 MB ℹ️ View Unchanged
|
04aec39
to
0ab1eda
Compare
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. |
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.
Nice work on adding test coverage for Block Hooks. Let's wait for the bug fix to land.
title: 'Navigation Menu', | ||
status: 'publish', | ||
content: | ||
'<!-- wp:navigation-link {"label":"wordpress.org","url":"https://wordpress.org","kind":"custom"} /-->', // '<!-- wp:page-list /-->', |
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.
Why is there a code comment with a different block included?
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.
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.
Oh, I think that's an oversight on my part. I'll remove it.
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.
962d917
to
495e14a
Compare
I landed #68926 and rebased the branch to ensure all tests pass on CI. |
page.locator( '.wp-block-navigation__container > *' ) | ||
).toHaveClass( [ | ||
'wp-block-navigation-item wp-block-home-link', | ||
' wp-block-navigation-item wp-block-navigation-link', |
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.
Is this preceding space intentional?
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.
Yeah, the selector doesn't work without it 😕 I guess it's a (minor) bug in the block code.
What?
Add end-to-end test coverage for Block Hooks; specifically for insertion into post content, synced patterns, and Navigation blocks. The tests check that hooked blocks are inserted correctly on the frontend, and that any changes made in the editor are persisted and respected.
They cover both "normal" insertion (i.e. before or after a given anchor block), and first/last child insertion with the containing block serving as the anchor block (which is when the corresponding post object's post meta is used to store
_wp_ignored_hooked_blocks
data).Note that some tests are currently failing. This is due to a bug uncovered while creating the tests. There's a fix in #69142. You can verify that it fixes the failing tests by locally cherry-picking 9750de5 on top of this PR.
Closes #68986.
Why?
While working on #68926, it became clear that manually testing all cases is becoming more and more unwieldy. It was thus suggested that we add e2e test coverage.
Testing Instructions
Check the relevant GHA workflows.
You can also run e2e tests locally:
Add
--headed
to see them run in a local Chromium instance.As mentioned above, they will currently fail. You can however cherry-pick 9750de5 (from #69142) and re-run tests to verify that it allows them to pass.
TODO
after
)