Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Fix E2E tests in WordPress 5.8 #8204
Fix E2E tests in WordPress 5.8 #8204
Changes from 2 commits
9807c03
3db882f
a609e00
a6ab27e
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
What's the
0
here? AFAIKselectBlock
only takes one argument.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.
Copied from https://github.com/WordPress/gutenberg/blob/8499a38f6d5f0cdfd86c4bf17d42f37232c72125/packages/e2e-test-utils/src/inserter.js#L61-L76
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.
Looks like
0
is the default argument here:https://github.com/WordPress/gutenberg/blob/8499a38f6d5f0cdfd86c4bf17d42f37232c72125/packages/block-editor/src/store/actions.js#L205-L223
Could be safely removed
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.
Instead of focusing the block, could we close the inserter manually somehow?
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.
Copied from https://github.com/WordPress/gutenberg/blob/8499a38f6d5f0cdfd86c4bf17d42f37232c72125/packages/e2e-test-utils/src/inserter.js#L147-L162
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, in that case, since our versions of
insertBlock
andwaitForInserterCloseAndContentFocus
are now identical to the ones from Gutenberg, we can just useinsertBlock
from@wordpress/e2e-test-utils
directly instead of copying everything.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.
Sadly we can't as the version of
@wordpress/e2e-test-utils
is a month out of date. AlsoWe support, 5.5, so have maintain our own version of these functions.
https://github.com/WordPress/gutenberg/tree/trunk/packages/e2e-test-utils
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 it? At first glance I don't see a difference from the package published on npm that we use and the Gutenberg
trunk
branch.I don't mind maintaining our own version of certain functions if they differ in logic, but here they seem identical to me. But happy to be corrected.
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 packages says, last published 1 month ago.
Inserter was updated 12 minutes ago.
What am I missing?
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.
That seems fine to me? Yes there's a recently modified file in there, but I don't see how that would affect us. That change is neither in core nor in the package version that we use. We also don't use any of the currently unreleased new features.
Putting this another way: if we just remove our own version of
insertBlock
and use the version from@wordpress/e2e-test-utils
, do the e2e tests still pass? If yes, I'd say we can safely remove our copy.