diff --git a/test/e2e/specs/editor/plugins/block-hooks.spec.js b/test/e2e/specs/editor/plugins/block-hooks.spec.js index 0f8268f0ea9f09..f4c78912aa16fd 100644 --- a/test/e2e/specs/editor/plugins/block-hooks.spec.js +++ b/test/e2e/specs/editor/plugins/block-hooks.spec.js @@ -4,8 +4,8 @@ const { test, expect } = require( '@wordpress/e2e-test-utils-playwright' ); test.describe( 'Block Hooks API', () => { - const anchorBlockMarkup = ` -
This is a test paragraph.
+ const anchorBlockMarkup = ` +This is a test paragraph.
`; const getHookedBlockClassName = ( relativePosition, anchorBlock ) => @@ -47,7 +47,11 @@ test.describe( 'Block Hooks API', () => { getHookedBlockSelector( 'last_child', 'core/post-content' ) ) ).toHaveCount( 1 ); - // TODO: Verify that it's after the test paragraph. + // Verify that the hook block is inserted after the test paragraph. + await expect( page.locator( '.entry-content p' ) ).toHaveClass( [ + 'test-paragraph', + getHookedBlockClassName( 'last_child', 'core/post-content' ), + ] ); } ); test( 'should insert hooked block as last child of Post Content block in editor', async ( { @@ -105,6 +109,10 @@ test.describe( 'Block Hooks API', () => { getHookedBlockSelector( 'last_child', 'core/post-content' ) ) ).toHaveCount( 1 ); - // TODO: Verify that it's before the test paragraph. + // Verify that the hooked block is now before the test paragraph. + await expect( page.locator( '.entry-content p' ) ).toHaveClass( [ + getHookedBlockClassName( 'last_child', 'core/post-content' ), + 'test-paragraph', + ] ); } ); } );