Skip to content

Commit

Permalink
expect notice on successful menu creation
Browse files Browse the repository at this point in the history
  • Loading branch information
MaggieCabrera committed Mar 2, 2023
1 parent a5d79b3 commit c9813b0
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions test/e2e/specs/editor/blocks/navigation.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,18 +117,20 @@ test.describe(
},
] );

// Snackbar notification should appear
await expect(
page.getByRole( 'button', {
name: 'Dismiss this notice',
text: 'Navigation Menu successfully created.',
} )
).toBeVisible();

// Check the block in the canvas.
await expect(
editor.canvas.locator(
`role=textbox[name="Navigation link text"i] >> text="Custom link"`
)
).toBeVisible( {
// Wait for the Nav block API request to resolve.
// Note: avoid waiting on network requests as these are not perceivable
// to the user.
// See: https://github.com/WordPress/gutenberg/pull/45070#issuecomment-1373712007.
timeout: 10000,
} );
).toBeVisible();

// Check the block in the frontend.
await page.goto( '/' );
Expand Down

0 comments on commit c9813b0

Please sign in to comment.