diff --git a/packages/e2e-tests/specs/editor/plugins/__snapshots__/cpt-locking.test.js.snap b/packages/e2e-tests/specs/editor/plugins/__snapshots__/cpt-locking.test.js.snap index 61302341dd961..157989c0da728 100644 --- a/packages/e2e-tests/specs/editor/plugins/__snapshots__/cpt-locking.test.js.snap +++ b/packages/e2e-tests/specs/editor/plugins/__snapshots__/cpt-locking.test.js.snap @@ -1,5 +1,23 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP +exports[`cpt locking template_lock all should insert line breaks when using enter and shift-enter 1`] = ` +" +
\\"\\"/
+ + + +

First line
Second line
Third line

+ + + +

+ + + +
+" +`; + exports[`cpt locking template_lock all should not error when deleting the cotents of a paragraph 1`] = ` "
\\"\\"/
diff --git a/packages/e2e-tests/specs/editor/plugins/cpt-locking.test.js b/packages/e2e-tests/specs/editor/plugins/cpt-locking.test.js index 5ab8f91bfa876..08002328af1ed 100644 --- a/packages/e2e-tests/specs/editor/plugins/cpt-locking.test.js +++ b/packages/e2e-tests/specs/editor/plugins/cpt-locking.test.js @@ -9,6 +9,7 @@ import { getEditedPostContent, insertBlock, pressKeyTimes, + pressKeyWithModifier, setPostContent, } from '@wordpress/e2e-test-utils'; @@ -85,6 +86,18 @@ describe( 'cpt locking', () => { expect( await getEditedPostContent() ).toMatchSnapshot(); } ); + it( 'should insert line breaks when using enter and shift-enter', async () => { + await page.click( + '.block-editor-block-list__block[data-type="core/paragraph"]' + ); + await page.keyboard.type( 'First line' ); + await pressKeyTimes( 'Enter', 1 ); + await page.keyboard.type( 'Second line' ); + await pressKeyWithModifier( 'shift', 'Enter' ); + await page.keyboard.type( 'Third line' ); + expect( await getEditedPostContent() ).toMatchSnapshot(); + } ); + it( 'should show invalid template notice if the blocks do not match the templte', async () => { const content = await getEditedPostContent(); const [ , contentWithoutImage ] = content.split(