Skip to content

Commit

Permalink
Testing: Verify shortcode block newlines preserved
Browse files Browse the repository at this point in the history
  • Loading branch information
aduth committed Jul 17, 2018
1 parent faa5e15 commit 9457f01
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
7 changes: 6 additions & 1 deletion test/e2e/specs/__snapshots__/adding-blocks.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,10 @@ exports[`adding blocks Should insert content using the placeholder and the regul
<!-- wp:preformatted -->
<pre class=\\"wp-block-preformatted\\">Pre text<br/><br/>Foo</pre>
<!-- /wp:preformatted -->"
<!-- /wp:preformatted -->
<!-- wp:shortcode -->
[myshortcode]With multiple
lines preserved[/myshortcode]
<!-- /wp:shortcode -->"
`;
7 changes: 7 additions & 0 deletions test/e2e/specs/adding-blocks.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,13 @@ describe( 'adding blocks', () => {
await pressTimes( 'Delete', 6 );
await page.keyboard.type( ' text' );

// Ensure newline preservation in shortcode block.
// See: https://github.com/WordPress/gutenberg/issues/4456
await insertBlock( 'Shortcode' );
await page.keyboard.type( '[myshortcode]With multiple' );
await page.keyboard.press( 'Enter' );
await page.keyboard.type( 'lines preserved[/myshortcode]' );

// Unselect blocks to avoid conflicts with the inbetween inserter
await page.click( '.editor-post-title__input' );

Expand Down

0 comments on commit 9457f01

Please sign in to comment.