Skip to content

Commit

Permalink
Conditionalise resolution function
Browse files Browse the repository at this point in the history
  • Loading branch information
getdave committed Mar 22, 2022
1 parent c2468d4 commit 8f3de45
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions packages/e2e-tests/specs/editor/blocks/navigation.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,7 @@ describe( 'Navigation', () => {
await setUpResponseMocking( [
{
match: ( request ) =>
request.method() === 'GET' &&
request.url().includes( `rest_route` ) &&
request.url().includes( `navigation` ) &&
request.url().includes( testNavId ),
Expand Down Expand Up @@ -390,7 +391,9 @@ describe( 'Navigation', () => {
await navBlock.waitForSelector( '.components-spinner' );

// Resolve the controlled mocked API request.
resolveNavigationRequest();
if ( typeof resolveNavigationRequest === 'function' ) {
resolveNavigationRequest();
}
} );

it( 'shows a loading indicator whilst empty Navigation menu is being created', async () => {
Expand Down Expand Up @@ -437,7 +440,9 @@ describe( 'Navigation', () => {
await navBlock.waitForSelector( '.components-spinner' );

// Resolve the controlled mocked API request.
resolveNavigationRequest();
if ( typeof resolveNavigationRequest === 'function' ) {
resolveNavigationRequest();
}
} );
} );

Expand Down

0 comments on commit 8f3de45

Please sign in to comment.