Skip to content

Commit

Permalink
Remove all references to the navigation areas (#41205)
Browse files Browse the repository at this point in the history
* Remove the mention of navigation-area.php

* Remove navigation areas from tests

* Restore the console warning expectation
  • Loading branch information
adamziel authored May 24, 2022
1 parent 9f1ca90 commit fdd079b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
1 change: 0 additions & 1 deletion lib/blocks.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
16 changes: 6 additions & 10 deletions packages/e2e-tests/specs/editor/blocks/navigation.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1346,11 +1346,9 @@ describe( 'Navigation', () => {
`//*[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 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();
} );

Expand All @@ -1369,11 +1367,9 @@ describe( 'Navigation', () => {
`//*[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 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();
} );
} );
Expand Down

0 comments on commit fdd079b

Please sign in to comment.