Skip to content

Commit

Permalink
Set the pageId for Multiple Queries tests
Browse files Browse the repository at this point in the history
  • Loading branch information
michalczaplinski committed Nov 21, 2024
1 parent 157a395 commit f6d39ad
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions test/e2e/specs/interactivity/instant-search.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -364,12 +364,14 @@ test.describe( 'Instant Search', () => {
} );

test.describe( 'Multiple Queries', () => {
let pageId: number;

const firstQueryId = 1234;
const secondQueryId = 5678;

test.beforeAll( async ( { requestUtils } ) => {
// Edit the Home template to include two custom queries
await requestUtils.createPage( {
const { id } = await requestUtils.createPage( {
status: 'publish',
title: 'Home',
content: `
Expand Down Expand Up @@ -419,10 +421,12 @@ test.describe( 'Instant Search', () => {
</div>
<!-- /wp:query -->`,
} );

pageId = id;
} );

test.beforeEach( async ( { page } ) => {
await page.goto( '/' );
await page.goto( `/?p=${ pageId }` );
} );

test( 'should handle searches independently', async ( { page } ) => {
Expand Down

0 comments on commit f6d39ad

Please sign in to comment.