From eac10df69abef1dd9f5e71c25f239ce22dd28ef2 Mon Sep 17 00:00:00 2001 From: iseulde Date: Fri, 19 Apr 2019 15:43:02 +0200 Subject: [PATCH] Add list e2e test --- .../specs/blocks/__snapshots__/list.test.js.snap | 6 ++++++ packages/e2e-tests/specs/blocks/list.test.js | 13 +++++++++++++ 2 files changed, 19 insertions(+) diff --git a/packages/e2e-tests/specs/blocks/__snapshots__/list.test.js.snap b/packages/e2e-tests/specs/blocks/__snapshots__/list.test.js.snap index 92fb70a48a60cc..fb0792da5c18e3 100644 --- a/packages/e2e-tests/specs/blocks/__snapshots__/list.test.js.snap +++ b/packages/e2e-tests/specs/blocks/__snapshots__/list.test.js.snap @@ -212,6 +212,12 @@ exports[`List should outdent with children 2`] = ` " `; +exports[`List should place the caret in the right place with nested list 1`] = ` +" + +" +`; + exports[`List should split indented list item 1`] = ` " diff --git a/packages/e2e-tests/specs/blocks/list.test.js b/packages/e2e-tests/specs/blocks/list.test.js index 776483ae4eb6a2..54d726aca6ae84 100644 --- a/packages/e2e-tests/specs/blocks/list.test.js +++ b/packages/e2e-tests/specs/blocks/list.test.js @@ -358,4 +358,17 @@ describe( 'List', () => { // That's 9 key presses to create the list, and 9 key presses to remove // the list. ;) } ); + + it( 'should place the caret in the right place with nested list', async () => { + await clickBlockAppender(); + await page.keyboard.type( '* 1' ); + await page.keyboard.press( 'Enter' ); + await page.keyboard.type( ' a' ); + await page.keyboard.press( 'ArrowUp' ); + await page.keyboard.press( 'Enter' ); + // The caret should land in the second item. + await page.keyboard.type( '2' ); + + expect( await getEditedPostContent() ).toMatchSnapshot(); + } ); } );