Skip to content

Commit

Permalink
Handle promises in parallel
Browse files Browse the repository at this point in the history
  • Loading branch information
talldan committed Jan 12, 2022
1 parent c8947ee commit bcc03c8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/e2e-tests/specs/editor/blocks/navigation.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -467,12 +467,13 @@ describe( 'Navigation', () => {
const draftLink = await page.waitForSelector(
'.wp-block-navigation-item__content'
);
await draftLink.click();
await page.waitForResponse(
const responsePromise = page.waitForResponse(
( response ) =>
response.url().includes( 'url-details' ) &&
response.status() === 404
);
const draftCreationPromise = draftLink.click();
await Promise.all( [ responsePromise, draftCreationPromise ] );
expect( console ).toHaveErroredWith(
'Failed to load resource: the server responded with a status of 404 (Not Found)'
);
Expand Down

0 comments on commit bcc03c8

Please sign in to comment.