Skip to content

Commit

Permalink
Add a failing test for removing an empty first line.
Browse files Browse the repository at this point in the history
  • Loading branch information
pento committed Jul 31, 2018
1 parent d2a34fb commit c64e6e3
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/e2e/specs/__snapshots__/splitting-merging.test.js.snap
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`splitting and merging blocks Should delete an empty first line 1`] = `
"<!-- wp:paragraph -->
<p></p>
<!-- /wp:paragraph -->"
`;

exports[`splitting and merging blocks Should delete wholly-selected block contents 1`] = `
"<!-- wp:paragraph -->
<p>Foo</p>
Expand Down
15 changes: 15 additions & 0 deletions test/e2e/specs/splitting-merging.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,4 +89,19 @@ describe( 'splitting and merging blocks', () => {

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

it( 'Should delete an empty first line', async () => {
// Regression Test: When a paragraph block has line break, and the first
// line has no text, pressing backspace at the start of the second line
// should remove the first.
await insertBlock( 'Paragraph' );
await page.keyboard.down( 'Shift' );
await page.keyboard.press( 'Enter' );
await page.keyboard.up( 'Shift' );

// Delete he soft line break.
await page.keyboard.press( 'Backspace' );

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

0 comments on commit c64e6e3

Please sign in to comment.