From 76319f8ac3a68c01966e6ba745511bf5a4677756 Mon Sep 17 00:00:00 2001 From: Jerry Jones Date: Tue, 16 May 2023 16:30:10 -0500 Subject: [PATCH] Fix navigation tests by creating pages for link control (#50680) --- .../specs/editor/blocks/navigation.spec.js | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/test/e2e/specs/editor/blocks/navigation.spec.js b/test/e2e/specs/editor/blocks/navigation.spec.js index dc30314195731..e776b160d55bc 100644 --- a/test/e2e/specs/editor/blocks/navigation.spec.js +++ b/test/e2e/specs/editor/blocks/navigation.spec.js @@ -396,6 +396,26 @@ test.describe( 'Navigation block', () => { `, }; + 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 } ) );