Skip to content

Commit

Permalink
Add e2e test for ordered split
Browse files Browse the repository at this point in the history
  • Loading branch information
ellatrix committed Apr 5, 2019
1 parent e47140f commit 1aec480
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
14 changes: 14 additions & 0 deletions packages/e2e-tests/specs/blocks/__snapshots__/list.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,20 @@ exports[`List should split indented list item 1`] = `
<!-- /wp:list -->"
`;
exports[`List should split into two ordered lists with paragraph 1`] = `
"<!-- wp:list {\\"ordered\\":true} -->
<ol><li>one</li></ol>
<!-- /wp:list -->
<!-- wp:paragraph -->
<p></p>
<!-- /wp:paragraph -->
<!-- wp:list {\\"ordered\\":true} -->
<ol><li>two</li></ol>
<!-- /wp:list -->"
`;
exports[`List should split into two with paragraph and merge lists 1`] = `
"<!-- wp:list -->
<ul><li>one</li><li></li><li>two</li></ul>
Expand Down
12 changes: 12 additions & 0 deletions packages/e2e-tests/specs/blocks/list.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,18 @@ describe( 'List', () => {
expect( await getEditedPostContent() ).toMatchSnapshot();
} );

it( 'should split into two ordered lists with paragraph', async () => {
await clickBlockAppender();
await page.keyboard.type( '1. one' );
await page.keyboard.press( 'Enter' );
await page.keyboard.type( 'two' );
await page.keyboard.press( 'ArrowUp' );
await page.keyboard.press( 'Enter' );
await page.keyboard.press( 'Enter' );

expect( await getEditedPostContent() ).toMatchSnapshot();
} );

it( 'should split indented list item', async () => {
await insertBlock( 'List' );
await page.keyboard.type( 'one' );
Expand Down

0 comments on commit 1aec480

Please sign in to comment.