Skip to content

Commit

Permalink
Fix navigation tests by creating pages for link control (#50680)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeryj authored May 16, 2023
1 parent 4556c86 commit 76319f8
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions test/e2e/specs/editor/blocks/navigation.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,26 @@ test.describe( 'Navigation block', () => {
<!-- /wp:navigation-submenu -->`,
};

test.beforeAll( async ( { requestUtils } ) => {
// We need pages to be published so the Link Control can return pages
await requestUtils.createPage( {
title: 'Test Page 1',
status: 'publish',
} );
await requestUtils.createPage( {
title: 'Test Page 2',
status: 'publish',
} );
await requestUtils.createPage( {
title: 'Test Page 3',
status: 'publish',
} );
} );

test.afterAll( async ( { requestUtils } ) => {
await requestUtils.deleteAllPages();
} );

test.use( {
linkControl: async ( { page }, use ) => {
await use( new LinkControl( { page } ) );
Expand Down

0 comments on commit 76319f8

Please sign in to comment.