From a71e09dbf541299b15dd7dd60f35019070030220 Mon Sep 17 00:00:00 2001 From: ntsekouras Date: Thu, 11 May 2023 17:08:49 +0300 Subject: [PATCH] update e2e test --- .../various/block-switcher-test.spec.js | 37 +++++++++++-------- 1 file changed, 21 insertions(+), 16 deletions(-) diff --git a/test/e2e/specs/editor/various/block-switcher-test.spec.js b/test/e2e/specs/editor/various/block-switcher-test.spec.js index c7a98d3de09ff..de7eb9b167b29 100644 --- a/test/e2e/specs/editor/various/block-switcher-test.spec.js +++ b/test/e2e/specs/editor/various/block-switcher-test.spec.js @@ -25,28 +25,33 @@ test.describe( 'Block Switcher', () => { }, ], } ); - expect( await editor.getEditedPostContent() ).toBe( - ` -
-

1

-
-` - ); // Transform to `Stack` variation. await editor.clickBlockToolbarButton( 'Stack' ); - const variations = page.getByRole( 'menu', { name: 'Stack' } ) - .getByRole( 'group', { name: 'variations' } ); + const variations = page + .getByRole( 'menu', { name: 'Stack' } ) + .getByRole( 'group' ); await expect( variations.getByRole( 'menuitem', { name: 'Stack' } ) ).toBeHidden(); await variations.getByRole( 'menuitem', { name: 'Row' } ).click(); - expect( await editor.getEditedPostContent() ).toBe( - ` -
-

1

-
-` - ); + expect( await editor.getBlocks() ).toMatchObject( [ + { + name: 'core/group', + attributes: expect.objectContaining( { + layout: { + type: 'flex', + flexWrap: 'nowrap', + orientation: undefined, + }, + } ), + innerBlocks: [ + { + name: 'core/paragraph', + attributes: { content: '1' }, + }, + ], + }, + ] ); await editor.clickBlockToolbarButton( 'Row' ); await expect( page.locator( 'role=menuitem[name="Stack"i]' )