Skip to content

Commit

Permalink
Add list e2e test
Browse files Browse the repository at this point in the history
  • Loading branch information
ellatrix committed Jul 24, 2019
1 parent 3364ec6 commit bc2dee1
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,12 @@ exports[`List should outdent with children 2`] = `
<!-- /wp:list -->"
`;
exports[`List should place the caret in the right place with nested list 1`] = `
"<!-- wp:list -->
<ul><li>1</li><li>2<ul><li>a</li></ul></li></ul>
<!-- /wp:list -->"
`;
exports[`List should split indented list item 1`] = `
"<!-- wp:list -->
<ul><li>one<ul><li>two</li><li>three</li></ul></li></ul>
Expand Down
13 changes: 13 additions & 0 deletions packages/e2e-tests/specs/blocks/list.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
} );
} );

0 comments on commit bc2dee1

Please sign in to comment.