Skip to content

Commit

Permalink
Add e2e test
Browse files Browse the repository at this point in the history
  • Loading branch information
ellatrix committed Jul 29, 2022
1 parent bda43ec commit 06ceef9
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions packages/e2e-tests/specs/editor/blocks/group.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,41 @@ describe( 'Group', () => {
<!-- /wp:paragraph -->"
` );
} );

it( 'can merge into group with Backspace', async () => {
await clickBlockAppender();
await page.keyboard.type( '1' );
await transformBlockTo( 'Group' );
await page.keyboard.press( 'Enter' );
await page.keyboard.type( '2' );

// Confirm last paragraph is outside of group.
expect( await getEditedPostContent() ).toMatchInlineSnapshot( `
"<!-- wp:group -->
<div class=\\"wp-block-group\\"><!-- wp:paragraph -->
<p>1</p>
<!-- /wp:paragraph --></div>
<!-- /wp:group -->
<!-- wp:paragraph -->
<p>2</p>
<!-- /wp:paragraph -->"
` );

// Merge the last paragraph into the group.
await page.keyboard.press( 'ArrowLeft' );
await page.keyboard.press( 'Backspace' );

expect( await getEditedPostContent() ).toMatchInlineSnapshot( `
"<!-- wp:group -->
<div class=\\"wp-block-group\\"><!-- wp:paragraph -->
<p>1</p>
<!-- /wp:paragraph -->
<!-- wp:paragraph -->
<p>2</p>
<!-- /wp:paragraph --></div>
<!-- /wp:group -->"
` );
} );
} );

0 comments on commit 06ceef9

Please sign in to comment.