Skip to content

Commit

Permalink
Await resolution to properly assert on loading state
Browse files Browse the repository at this point in the history
  • Loading branch information
getdave committed Jan 4, 2023
1 parent 0ff5dee commit bf42d5e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions test/e2e/specs/editor/blocks/navigation.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ test.describe(
} ) => {
await editor.insertBlock( { name: 'core/navigation' } );

// Necessary to wait for the block to be in loaded state else
// initial rendered state will not be resolved.
await page.waitForLoadState( 'networkidle' );

// Check Page List is in the list view.

// Open the list view.
Expand All @@ -50,9 +54,7 @@ test.describe(
`//a[.//span[text()='Page List']]`
);

// Todo: wait on resolution state of the block
// in order to proceed with assertion using `toBeVisible()`.
await expect( pageListSelector ).toBeTruthy();
await expect( pageListSelector ).toBeVisible();

// Check the markup of the block is correct.
await editor.publishPost();
Expand Down

1 comment on commit bf42d5e

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flaky tests detected.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/3837644837
📝 Reported issues:

Please sign in to comment.