From 0779690cf4345a2468e294cbab0c8f6b805073fb Mon Sep 17 00:00:00 2001 From: Seghir Nadir Date: Fri, 26 Jul 2019 11:28:56 +0100 Subject: [PATCH] Relax Cover and Media+Text inner blocks restrictions (#16751) --- packages/block-library/src/cover/edit.js | 2 -- packages/block-library/src/media-text/edit.js | 2 -- .../__snapshots__/media-text.test.js.snap | 10 -------- .../e2e-tests/specs/blocks/media-text.test.js | 24 ------------------- 4 files changed, 38 deletions(-) delete mode 100644 packages/e2e-tests/specs/blocks/__snapshots__/media-text.test.js.snap delete mode 100644 packages/e2e-tests/specs/blocks/media-text.test.js diff --git a/packages/block-library/src/cover/edit.js b/packages/block-library/src/cover/edit.js index 7de37e53f3fc3..6ba81ed2d9688 100644 --- a/packages/block-library/src/cover/edit.js +++ b/packages/block-library/src/cover/edit.js @@ -54,7 +54,6 @@ const INNER_BLOCKS_TEMPLATE = [ placeholder: __( 'Write title…' ), } ], ]; -const INNER_BLOCKS_ALLOWED_BLOCKS = [ 'core/button', 'core/heading', 'core/paragraph' ]; function retrieveFastAverageColor() { if ( ! retrieveFastAverageColor.fastAverageColor ) { @@ -299,7 +298,6 @@ class CoverEdit extends Component {
diff --git a/packages/block-library/src/media-text/edit.js b/packages/block-library/src/media-text/edit.js index f6594b7a71a59..782aee3bacf4d 100644 --- a/packages/block-library/src/media-text/edit.js +++ b/packages/block-library/src/media-text/edit.js @@ -33,7 +33,6 @@ import MediaContainer from './media-container'; /** * Constants */ -const ALLOWED_BLOCKS = [ 'core/button', 'core/paragraph', 'core/heading', 'core/list' ]; const TEMPLATE = [ [ 'core/paragraph', { fontSize: 'large', placeholder: _x( 'Content…', 'content placeholder' ) } ], ]; @@ -233,7 +232,6 @@ class MediaTextEdit extends Component {
{ this.renderMediaArea() } diff --git a/packages/e2e-tests/specs/blocks/__snapshots__/media-text.test.js.snap b/packages/e2e-tests/specs/blocks/__snapshots__/media-text.test.js.snap deleted file mode 100644 index 7ce74edf9b706..0000000000000 --- a/packages/e2e-tests/specs/blocks/__snapshots__/media-text.test.js.snap +++ /dev/null @@ -1,10 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`Media Text restricts blocks that can be inserted 1`] = ` -Array [ - "Button", - "Heading", - "List", - "Paragraph", -] -`; diff --git a/packages/e2e-tests/specs/blocks/media-text.test.js b/packages/e2e-tests/specs/blocks/media-text.test.js deleted file mode 100644 index 2e59b77670327..0000000000000 --- a/packages/e2e-tests/specs/blocks/media-text.test.js +++ /dev/null @@ -1,24 +0,0 @@ -/** - * WordPress dependencies - */ -import { - createNewPost, - getAllBlockInserterItemTitles, - insertBlock, - openAllBlockInserterCategories, - openGlobalBlockInserter, -} from '@wordpress/e2e-test-utils'; - -describe( 'Media Text', () => { - beforeEach( async () => { - await createNewPost(); - } ); - - it( 'restricts blocks that can be inserted', async () => { - await insertBlock( 'Media & Text' ); - await page.click( '.wp-block-media-text .block-editor-rich-text' ); - await openGlobalBlockInserter(); - await openAllBlockInserterCategories(); - expect( await getAllBlockInserterItemTitles() ).toMatchSnapshot(); - } ); -} );