From 0eb4c1ebf5132f35efc8db81a4f1452f8ec17fd1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20Zieli=C5=84ski?= Date: Fri, 20 May 2022 17:25:36 +0200 Subject: [PATCH 1/3] Remove the mention of navigation-area.php --- lib/blocks.php | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/blocks.php b/lib/blocks.php index 3670cc587d9309..3f0e8a547a8686 100644 --- a/lib/blocks.php +++ b/lib/blocks.php @@ -71,7 +71,6 @@ function gutenberg_reregister_core_block_types() { 'latest-posts.php' => 'core/latest-posts', 'loginout.php' => 'core/loginout', 'navigation.php' => 'core/navigation', - 'navigation-area.php' => 'core/navigation-area', 'navigation-link.php' => 'core/navigation-link', 'navigation-submenu.php' => 'core/navigation-submenu', 'page-list.php' => 'core/page-list', From ecdf4c4ab3f410482df6e64b12cebb981dff07fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20Zieli=C5=84ski?= Date: Fri, 20 May 2022 17:27:45 +0200 Subject: [PATCH 2/3] Remove navigation areas from tests --- .../specs/editor/blocks/navigation.test.js | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/packages/e2e-tests/specs/editor/blocks/navigation.test.js b/packages/e2e-tests/specs/editor/blocks/navigation.test.js index df835bcbc01378..1278c1d22289ea 100644 --- a/packages/e2e-tests/specs/editor/blocks/navigation.test.js +++ b/packages/e2e-tests/specs/editor/blocks/navigation.test.js @@ -1345,13 +1345,6 @@ describe( 'Navigation', () => { await page.waitForXPath( `//*[contains(@class, 'components-snackbar__content')][ text()="You do not have permission to edit this Menu. Any changes made will not be saved." ]` ); - - // Expect a console 403 for request to Navigation Areas for lower permission users. - // This is because reading requires the `edit_theme_options` capability - // which the Contributor level user does not have. - // See: https://github.com/WordPress/gutenberg/blob/4cedaf0c4abb0aeac4bfd4289d63e9889efe9733/lib/class-wp-rest-block-navigation-areas-controller.php#L81-L91. - // Todo: removed once Nav Areas are removed from the Gutenberg Plugin. - expect( console ).toHaveErrored(); } ); it( 'shows a warning if user does not have permission to create navigation menus', async () => { @@ -1368,13 +1361,6 @@ describe( 'Navigation', () => { await page.waitForXPath( `//*[contains(@class, 'components-snackbar__content')][ text()="${ noticeText }" ]` ); - - // Expect a console 403 for request to Navigation Areas for lower permission users. - // This is because reading requires the `edit_theme_options` capability - // which the Contributor level user does not have. - // See: https://github.com/WordPress/gutenberg/blob/4cedaf0c4abb0aeac4bfd4289d63e9889efe9733/lib/class-wp-rest-block-navigation-areas-controller.php#L81-L91. - // Todo: removed once Nav Areas are removed from the Gutenberg Plugin. - expect( console ).toHaveErrored(); } ); } ); From b23987d533d324a45b11366c44d6a70e9922d14f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20Zieli=C5=84ski?= Date: Tue, 24 May 2022 11:54:18 +0200 Subject: [PATCH 3/3] Restore the console warning expectation --- .../e2e-tests/specs/editor/blocks/navigation.test.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/packages/e2e-tests/specs/editor/blocks/navigation.test.js b/packages/e2e-tests/specs/editor/blocks/navigation.test.js index 1278c1d22289ea..71effc7b96652a 100644 --- a/packages/e2e-tests/specs/editor/blocks/navigation.test.js +++ b/packages/e2e-tests/specs/editor/blocks/navigation.test.js @@ -1345,6 +1345,11 @@ describe( 'Navigation', () => { await page.waitForXPath( `//*[contains(@class, 'components-snackbar__content')][ text()="You do not have permission to edit this Menu. Any changes made will not be saved." ]` ); + + // Expect a console 403 for requests to: + // * /wp/v2/settings?_locale=user + // * /wp/v2/templates?context=edit&post_type=post&per_page=100&_locale=user + expect( console ).toHaveErrored(); } ); it( 'shows a warning if user does not have permission to create navigation menus', async () => { @@ -1361,6 +1366,11 @@ describe( 'Navigation', () => { await page.waitForXPath( `//*[contains(@class, 'components-snackbar__content')][ text()="${ noticeText }" ]` ); + + // Expect a console 403 for requests to: + // * /wp/v2/settings?_locale=user + // * /wp/v2/templates?context=edit&post_type=post&per_page=100&_locale=user + expect( console ).toHaveErrored(); } ); } );