From 2471ce197d9ce5e9f2be27fd15c84c5c39de3a39 Mon Sep 17 00:00:00 2001 From: Riad Benguella Date: Wed, 10 Feb 2021 14:46:05 +0100 Subject: [PATCH] Fix more end2end tests --- .../specs/experiments/multi-entity-editing.test.js | 14 +++++++++++++- .../specs/experiments/multi-entity-saving.test.js | 4 ---- .../specs/experiments/template-part.test.js | 5 ----- 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/packages/e2e-tests/specs/experiments/multi-entity-editing.test.js b/packages/e2e-tests/specs/experiments/multi-entity-editing.test.js index fb200ce93a6b37..3535ffcfc0b7eb 100644 --- a/packages/e2e-tests/specs/experiments/multi-entity-editing.test.js +++ b/packages/e2e-tests/specs/experiments/multi-entity-editing.test.js @@ -8,6 +8,8 @@ import { trashAllPosts, activateTheme, canvas, + openDocumentSettingsSidebar, + pressKeyWithModifier, } from '@wordpress/e2e-test-utils'; /** @@ -37,7 +39,17 @@ const createTemplatePart = async ( ? '.wp-block-template-part .wp-block-template-part .block-editor-block-list__layout' : '.wp-block-template-part .block-editor-block-list__layout' ); - await page.focus( '.wp-block-template-part__name-panel input' ); + await openDocumentSettingsSidebar(); + + const nameInputSelector = + '.block-editor-block-inspector .components-text-control__input'; + const nameInput = await page.waitForSelector( nameInputSelector ); + await nameInput.click(); + + // Select all of the text in the title field. + await pressKeyWithModifier( 'primary', 'a' ); + + // Give the reusable block a title await page.keyboard.type( templatePartName ); }; diff --git a/packages/e2e-tests/specs/experiments/multi-entity-saving.test.js b/packages/e2e-tests/specs/experiments/multi-entity-saving.test.js index dc494849089ad3..c0c035ccd0894d 100644 --- a/packages/e2e-tests/specs/experiments/multi-entity-saving.test.js +++ b/packages/e2e-tests/specs/experiments/multi-entity-saving.test.js @@ -112,10 +112,6 @@ describe( 'Multi-entity save flow', () => { // Should trigger multi-entity save button once template part edited. await assertMultiSaveEnabled(); - // TODO: Remove when toolbar supports text fields - expect( console ).toHaveWarnedWith( - 'Using custom components as toolbar controls is deprecated. Please use ToolbarItem or ToolbarButton components instead. See: https://developer.wordpress.org/block-editor/components/toolbar-button/#inside-blockcontrols' - ); // Should only have save panel a11y button active after child entities edited. await assertExistance( publishA11ySelector, false ); diff --git a/packages/e2e-tests/specs/experiments/template-part.test.js b/packages/e2e-tests/specs/experiments/template-part.test.js index a6e628ffc067b1..88ffee5efbc081 100644 --- a/packages/e2e-tests/specs/experiments/template-part.test.js +++ b/packages/e2e-tests/specs/experiments/template-part.test.js @@ -248,11 +248,6 @@ describe( 'Template Part', () => { testContentSelector ); expect( templatePartContent ).toBeTruthy(); - - // TODO: Remove when toolbar supports text fields - expect( console ).toHaveWarnedWith( - 'Using custom components as toolbar controls is deprecated. Please use ToolbarItem or ToolbarButton components instead. See: https://developer.wordpress.org/block-editor/components/toolbar-button/#inside-blockcontrols' - ); } ); } ); } );