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 a7212afc153e6f..9ce876ee4aebec 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(); + } ); } );