From 16e54e936e71b74ba7da446d1d45f31f847f5e32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9?= <583546+oandregal@users.noreply.github.com> Date: Wed, 20 Apr 2022 14:47:26 +0200 Subject: [PATCH] e2e test: style variations - update paragraph representation - select quote block --- .../editor/various/style-variation.test.js | 40 ------------------- .../editor/various/style-variation.spec.js | 7 +++- 2 files changed, 6 insertions(+), 41 deletions(-) delete mode 100644 packages/e2e-tests/specs/editor/various/style-variation.test.js diff --git a/packages/e2e-tests/specs/editor/various/style-variation.test.js b/packages/e2e-tests/specs/editor/various/style-variation.test.js deleted file mode 100644 index 5981f3276ecc2f..00000000000000 --- a/packages/e2e-tests/specs/editor/various/style-variation.test.js +++ /dev/null @@ -1,40 +0,0 @@ -/** - * WordPress dependencies - */ -import { - createNewPost, - clickBlockToolbarButton, - insertBlock, - getEditedPostContent, -} from '@wordpress/e2e-test-utils'; - -describe( 'adding blocks', () => { - beforeAll( async () => { - await createNewPost(); - } ); - - it( 'Should switch to the plain style of the quote block', async () => { - // Inserting a quote block. - await insertBlock( 'Quote' ); - await page.keyboard.type( 'Quote content' ); - // Select the quote block. - await page.keyboard.press( 'ArrowDown' ); - - await clickBlockToolbarButton( 'Quote' ); - - const plainStyleButton = await page.waitForXPath( - '//*[@role="menuitem"][contains(., "Plain")]' - ); - await plainStyleButton.click(); - - // Check the content. - const content = await getEditedPostContent(); - expect( content ).toMatchInlineSnapshot( ` - " -
-

Quote content

-
- " - ` ); - } ); -} ); diff --git a/test/e2e/specs/editor/various/style-variation.spec.js b/test/e2e/specs/editor/various/style-variation.spec.js index 3deabe1c7b508b..ef960907cd89bd 100644 --- a/test/e2e/specs/editor/various/style-variation.spec.js +++ b/test/e2e/specs/editor/various/style-variation.spec.js @@ -16,6 +16,9 @@ test.describe( 'adding blocks', () => { attributes: { value: '

Quote content

' }, } ); + // Select the quote block. + await page.keyboard.press( 'ArrowDown' ); + await pageUtils.clickBlockToolbarButton( 'Quote' ); await page.click( 'role=menuitem[name="Plain"i]' ); @@ -24,7 +27,9 @@ test.describe( 'adding blocks', () => { const content = await pageUtils.getEditedPostContent(); expect( content ).toBe( ` -

Quote content

+
+

Quote content

+
` ); } );