diff --git a/packages/e2e-test-utils-playwright/src/editor/get-blocks.ts b/packages/e2e-test-utils-playwright/src/editor/get-blocks.ts index dba597a19c983..70a5a03628ee0 100644 --- a/packages/e2e-test-utils-playwright/src/editor/get-blocks.ts +++ b/packages/e2e-test-utils-playwright/src/editor/get-blocks.ts @@ -15,14 +15,11 @@ export async function getBlocks( this: Editor ) { const blocks = window.wp.data.select( 'core/block-editor' ).getBlocks(); // The editor might still contain an unmodified empty block even when it's technically "empty". - if ( blocks.length === 1 ) { - const blockName = blocks[ 0 ].name; - if ( - blockName === window.wp.blocks.getDefaultBlockName() || - blockName === window.wp.blocks.getFreeformContentHandlerName() - ) { - return []; - } + if ( + blocks.length === 1 && + window.wp.blocks.isUnmodifiedDefaultBlock( blocks[ 0 ] ) + ) { + return []; } return blocks;