Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 13 additions & 6 deletions packages/e2e-tests/specs/editor/blocks/navigation.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,19 @@ describe( 'Navigation', () => {
} );

it( 'allows pages to be created from the navigation block and their links added to menu', async () => {
// The URL Details endpoint 404s for the created page, since it will
// be a draft that is inaccessible publicly. To avoid this we mock
// out the endpoint response to be empty which will be handled gracefully
// in the UI whilst avoiding any 404s.
await setUpResponseMocking( [
{
match: ( request ) =>
request.url().includes( `rest_route` ) &&
request.url().includes( `url-details` ),
onRequestMatch: createJSONResponse( [] ),
},
] );

await createNewPost();
await insertBlock( 'Navigation' );
const startEmptyButton = await page.waitForXPath( START_EMPTY_XPATH );
Expand Down Expand Up @@ -469,12 +482,6 @@ describe( 'Navigation', () => {
`//a[contains(@class, "block-editor-link-control__search-item-title") and contains(., "${ pageTitle }")]`
);

// The URL Details endpoint 404s for the created page, since it will
// be a draft that is inaccessible publicly. Wait for the HTTP request
// to finish, since this seems to make the test more stable.
await page.waitForNetworkIdle();
expect( console ).toHaveErrored();

await publishPost();

// Expect a Navigation Block with a link for "A really long page name that will not exist".
Expand Down