Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions e2e/components/AnchoredOverlay.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {themes} from '../test-helpers/themes'
const stories: Array<{
title: string
id: string
buttonName?: string
}> = [
// Default
{
Expand Down Expand Up @@ -59,6 +60,7 @@ const stories: Array<{
{
title: 'Fullscreen Variant',
id: 'components-anchoredoverlay-features--fullscreen-variant',
buttonName: 'Open Fullscreen on Narrow',
},
// Dev
{
Expand Down Expand Up @@ -95,8 +97,9 @@ test.describe('AnchoredOverlay', () => {
})

// Open the overlay
await page.locator('button', {hasText: 'Button'}).waitFor()
await page.getByRole('button', {name: 'Button'}).click()
const buttonName = story.buttonName ?? 'Button'
await page.locator('button', {hasText: buttonName}).first().waitFor()
await page.getByRole('button', {name: buttonName}).first().click()

expect(await page.screenshot({animations: 'disabled'})).toMatchSnapshot(
`AnchoredOverlay.${story.title}.${theme}${namePostfix}.png`,
Expand Down