Skip to content

Commit

Permalink
Remove Page List from tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
jasmussen committed Jan 26, 2022
1 parent c8520cb commit 0eeb369
Showing 1 changed file with 0 additions and 50 deletions.
50 changes: 0 additions & 50 deletions packages/e2e-tests/specs/editor/blocks/navigation.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@ async function selectClassicMenu( optionText ) {
const PLACEHOLDER_ACTIONS_CLASS = 'wp-block-navigation-placeholder__actions';
const PLACEHOLDER_ACTIONS_XPATH = `//*[contains(@class, '${ PLACEHOLDER_ACTIONS_CLASS }')]`;
const START_EMPTY_XPATH = `${ PLACEHOLDER_ACTIONS_XPATH }//button[text()='Start empty']`;
const ADD_ALL_PAGES_XPATH = `${ PLACEHOLDER_ACTIONS_XPATH }//button[text()='Add all pages']`;
const SELECT_MENU_XPATH = `${ PLACEHOLDER_ACTIONS_XPATH }//button[text()='Select menu']`;

/**
Expand Down Expand Up @@ -154,24 +153,6 @@ async function deleteAll( endpoints ) {
}
}

/**
* Create a set of pages using the REST API.
*
* @param {Array} pages An array of page objects.
*/
async function createPages( pages ) {
for ( const page of pages ) {
await rest( {
method: 'POST',
path: PAGES_ENDPOINT,
data: {
status: 'publish',
...page,
},
} );
}
}

/**
* Replace unique ids in nav block content, since these won't be consistent
* between test runs.
Expand Down Expand Up @@ -257,37 +238,6 @@ describe( 'Navigation', () => {
} );

describe( 'placeholder', () => {
it( 'allows a navigation block to be created using existing pages', async () => {
await createPages( [
{
title: 'About',
menu_order: 0,
},
{
title: 'Contact Us',
menu_order: 1,
},
{
title: 'FAQ',
menu_order: 2,
},
] );

await createNewPost();

// Add the navigation block.
await insertBlock( 'Navigation' );
const allPagesButton = await page.waitForXPath(
ADD_ALL_PAGES_XPATH
);
await allPagesButton.click();

// Wait for the page list block to be present
await page.waitForSelector( 'ul[aria-label="Block: Page List"]' );

expect( await getNavigationMenuRawContent() ).toMatchSnapshot();
} );

it( 'allows a navigation block to be created from existing menus', async () => {
await createClassicMenu( { name: 'Test Menu 1' } );
await createClassicMenu(
Expand Down

0 comments on commit 0eeb369

Please sign in to comment.