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

Fix editor.getBlocks for unmodified default block #48093

Merged
merged 1 commit into from
Feb 15, 2023
Merged

Conversation

kevin940726
Copy link
Member

What?

A recent change in #47926 broke editor.getBlocks. A single paragraph block in the content will still return an empty array by editor.getBlocks().

Why?

I was not checking for the content of the default block 😞 .

How?

Use wp.blocks.isUnmodifiedDefaultBlock.

Testing Instructions

CI should pass.

@github-actions
Copy link

github-actions bot commented Feb 15, 2023

Flaky tests detected in 82a5aeb.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/4182391042
📝 Reported issues:

t-hamano added a commit that referenced this pull request Feb 15, 2023
Copy link
Contributor

@t-hamano t-hamano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍
As mentioned in this comment, I temporarily applied this PR change to #47972 and it passed all tests.

I think the currently failing tests aren't the result of this PR 🙂

@kevin940726 kevin940726 enabled auto-merge (squash) February 15, 2023 13:08
@kevin940726 kevin940726 merged commit 63079c7 into trunk Feb 15, 2023
@kevin940726 kevin940726 deleted the fix/get-blocks branch February 15, 2023 13:32
@github-actions github-actions bot added this to the Gutenberg 15.2 milestone Feb 15, 2023
@DaisyOlsen DaisyOlsen added the [Package] E2E Test Utils /packages/e2e-test-utils label Feb 15, 2023
t-hamano added a commit that referenced this pull request Feb 21, 2023
…o all editor instances (#47972)

* Apply keyboard shortcut conversions between paragraphs and headings to all editor instances

* Try to fix e2e tests

* Try to fix e2e tests

* Add comment

* Remove unnecessary files

* Use toMatchObject instead of toBe

* Temporarily apply #48093 changes

* Fix test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Package] E2E Test Utils /packages/e2e-test-utils [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants