Skip to content

Fix editor.getBlocks for unmodified default block - #48093

Merged
kevin940726 merged 1 commit into
trunkfrom
fix/get-blocks
Feb 15, 2023
Merged

kevin940726 merged 1 commit into
trunkfrom
fix/get-blocks

Conversation

@kevin940726

Copy link
Copy Markdown
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

github-actions Bot commented Feb 15, 2023 •

Copy link
Copy Markdown

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

@t-hamano t-hamano left a comment •

Copy link
Copy Markdown
Contributor

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 [Tool] E2E Test Utils /packages/e2e-test-utils-playwright 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

[Tool] E2E Test Utils /packages/e2e-test-utils-playwright [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