From cdbe0502798da820055be1810385bf47dbd9ebc8 Mon Sep 17 00:00:00 2001 From: iseulde Date: Wed, 20 Mar 2019 13:48:07 +0100 Subject: [PATCH] Add e2e test --- .../specs/__snapshots__/writing-flow.test.js.snap | 10 ++++++++++ packages/e2e-tests/specs/writing-flow.test.js | 12 ++++++++++++ 2 files changed, 22 insertions(+) diff --git a/packages/e2e-tests/specs/__snapshots__/writing-flow.test.js.snap b/packages/e2e-tests/specs/__snapshots__/writing-flow.test.js.snap index 41f6fe04a2b531..2a80f20633a953 100644 --- a/packages/e2e-tests/specs/__snapshots__/writing-flow.test.js.snap +++ b/packages/e2e-tests/specs/__snapshots__/writing-flow.test.js.snap @@ -126,6 +126,16 @@ exports[`adding blocks should navigate around nested inline boundaries 2`] = ` " `; +exports[`adding blocks should navigate empty paragraph 1`] = ` +" +

1

+ + + +

2

+" +`; + exports[`adding blocks should not create extra line breaks in multiline value 1`] = ` "

diff --git a/packages/e2e-tests/specs/writing-flow.test.js b/packages/e2e-tests/specs/writing-flow.test.js index 62ece158016405..c186507a7cdef3 100644 --- a/packages/e2e-tests/specs/writing-flow.test.js +++ b/packages/e2e-tests/specs/writing-flow.test.js @@ -298,4 +298,16 @@ describe( 'adding blocks', () => { // Check that none of the paragraph blocks have
in them. expect( await getEditedPostContent() ).toMatchSnapshot(); } ); + + it( 'should navigate empty paragraph', async () => { + await clickBlockAppender(); + await page.keyboard.press( 'Enter' ); + await page.waitForFunction( () => document.activeElement.isContentEditable ); + await page.keyboard.press( 'ArrowLeft' ); + await page.keyboard.type( '1' ); + await page.keyboard.press( 'ArrowRight' ); + await page.keyboard.type( '2' ); + + expect( await getEditedPostContent() ).toMatchSnapshot(); + } ); } );