Skip to content

Commit

Permalink
Add fixtures for #3044
Browse files Browse the repository at this point in the history
  • Loading branch information
siddharthkp committed Jul 10, 2023
1 parent fc5edd8 commit 8ffcbb2
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 0 deletions.
35 changes: 35 additions & 0 deletions e2e/components/ActionList.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -478,4 +478,39 @@ test.describe('ActionList', () => {
})
}
})

test.describe('All combinations', () => {
for (const theme of themes) {
test.describe(theme, () => {
test('default @vrt', async ({page}) => {
await visit(page, {
id: 'components-actionlist-examples--all-combinations',
globals: {
colorScheme: theme,
},
})

// Resize to fit long page
await page.setViewportSize({width: 1000, height: 1000})

// Default state
expect(await page.screenshot()).toMatchSnapshot(`ActionList.All combinations.${theme}.png`)

// Hover state
await page.getByRole('listitem', {name: 'Danger inline description'}).hover()
expect(await page.screenshot()).toMatchSnapshot(`ActionList.All combinations.${theme}.hover.png`)
})

test('axe @aat', async ({page}) => {
await visit(page, {
id: 'components-actionlist-features--all-combinations',
globals: {
colorScheme: theme,
},
})
await expect(page).toHaveNoViolations()
})
})
}
})
})
11 changes: 11 additions & 0 deletions src/ActionList/ActionList.examples.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,17 @@ export function AllCombinations(): JSX.Element {
<StarIcon />
</ActionList.TrailingVisual>
</ActionList.Item>
<ActionList.Item variant="danger">
<ActionList.LeadingVisual>
<StarIcon />
</ActionList.LeadingVisual>
Danger
<ActionList.Description variant="inline">inline description</ActionList.Description>
<ActionList.Description variant="block">Block description</ActionList.Description>
<ActionList.TrailingVisual>
<StarIcon />
</ActionList.TrailingVisual>
</ActionList.Item>
</ActionList>
</Box>
</>
Expand Down

0 comments on commit 8ffcbb2

Please sign in to comment.