import {test, expect} from '@playwright/test' import {visit} from '../test-helpers/storybook' import {themes} from '../test-helpers/themes' test.describe('ActionList', () => { test.describe('Default', () => { for (const theme of themes) { test.describe(theme, () => { test('default @vrt', async ({page}) => { await visit(page, { id: 'components-actionlist--default', globals: { colorScheme: theme, }, }) // Default state expect(await page.screenshot()).toMatchSnapshot(`ActionList.Default.${theme}.png`) }) test('axe @aat', async ({page}) => { await visit(page, { id: 'components-actionlist--default', globals: { colorScheme: theme, }, }) await expect(page).toHaveNoViolations() }) }) } }) test.describe('Block Description', () => { for (const theme of themes) { test.describe(theme, () => { test('default @vrt', async ({page}) => { await visit(page, { id: 'components-actionlist-features--block-description', globals: { colorScheme: theme, }, }) // Default state expect(await page.screenshot()).toMatchSnapshot(`ActionList.Block Description.${theme}.png`) }) test('axe @aat', async ({page}) => { await visit(page, { id: 'components-actionlist-features--block-description', globals: { colorScheme: theme, }, }) await expect(page).toHaveNoViolations() }) }) } }) test.describe('Disabled Item', () => { for (const theme of themes) { test.describe(theme, () => { test('default @vrt', async ({page}) => { await visit(page, { id: 'components-actionlist-features--disabled-item', globals: { colorScheme: theme, }, }) // Default state expect(await page.screenshot()).toMatchSnapshot(`ActionList.Disabled Item.${theme}.png`) }) test('axe @aat', async ({page}) => { await visit(page, { id: 'components-actionlist-features--disabled-item', globals: { colorScheme: theme, }, }) await expect(page).toHaveNoViolations() }) }) } }) test.describe('Inline Description', () => { for (const theme of themes) { test.describe(theme, () => { test('default @vrt', async ({page}) => { await visit(page, { id: 'components-actionlist-features--inline-description', globals: { colorScheme: theme, }, }) // Default state expect(await page.screenshot()).toMatchSnapshot(`ActionList.Inline Description.${theme}.png`) }) test('axe @aat', async ({page}) => { await visit(page, { id: 'components-actionlist-features--inline-description', globals: { colorScheme: theme, }, }) await expect(page).toHaveNoViolations() }) }) } }) test.describe('Inside Overlay', () => { for (const theme of themes) { test.describe(theme, () => { test('default @vrt', async ({page}) => { await visit(page, { id: 'components-actionlist-features--inside-overlay', globals: { colorScheme: theme, }, }) // Default state expect(await page.screenshot()).toMatchSnapshot(`ActionList.Inside Overlay.${theme}.png`) }) test('axe @aat', async ({page}) => { await visit(page, { id: 'components-actionlist-features--inside-overlay', globals: { colorScheme: theme, }, }) await expect(page).toHaveNoViolations() }) }) } }) test.describe('Item Dividers', () => { for (const theme of themes) { test.describe(theme, () => { test('default @vrt', async ({page}) => { await visit(page, { id: 'components-actionlist-features--item-dividers', globals: { colorScheme: theme, }, }) // Default state expect(await page.screenshot()).toMatchSnapshot(`ActionList.Item Dividers.${theme}.png`) }) test('axe @aat', async ({page}) => { await visit(page, { id: 'components-actionlist-features--item-dividers', globals: { colorScheme: theme, }, }) await expect(page).toHaveNoViolations() }) }) } }) test.describe('Links', () => { for (const theme of themes) { test.describe(theme, () => { test('default @vrt', async ({page}) => { await visit(page, { id: 'components-actionlist-features--links', globals: { colorScheme: theme, }, }) // Default state expect(await page.screenshot()).toMatchSnapshot(`ActionList.Links.${theme}.png`) }) test('axe @aat', async ({page}) => { await visit(page, { id: 'components-actionlist-features--links', globals: { colorScheme: theme, }, }) await expect(page).toHaveNoViolations() }) }) } }) test.describe('Multi Select', () => { for (const theme of themes) { test.describe(theme, () => { test('default @vrt', async ({page}) => { await visit(page, { id: 'components-actionlist-features--multi-select', globals: { colorScheme: theme, }, }) // Default state expect(await page.screenshot({animations: 'disabled'})).toMatchSnapshot( `ActionList.Multi Select.${theme}.png`, ) }) test('axe @aat', async ({page}) => { await visit(page, { id: 'components-actionlist-features--multi-select', globals: { colorScheme: theme, }, }) await expect(page).toHaveNoViolations() }) }) } }) test.describe('Simple List', () => { for (const theme of themes) { test.describe(theme, () => { test('default @vrt', async ({page}) => { await visit(page, { id: 'components-actionlist-features--simple-list', globals: { colorScheme: theme, }, }) // Default state expect(await page.screenshot()).toMatchSnapshot(`ActionList.Simple List.${theme}.png`) }) test('axe @aat', async ({page}) => { await visit(page, { id: 'components-actionlist-features--simple-list', globals: { colorScheme: theme, }, }) await expect(page).toHaveNoViolations() }) }) } }) test.describe('Single Divider', () => { for (const theme of themes) { test.describe(theme, () => { test('default @vrt', async ({page}) => { await visit(page, { id: 'components-actionlist-features--single-divider', globals: { colorScheme: theme, }, }) // Default state expect(await page.screenshot()).toMatchSnapshot(`ActionList.Single Divider.${theme}.png`) }) test('axe @aat', async ({page}) => { await visit(page, { id: 'components-actionlist-features--single-divider', globals: { colorScheme: theme, }, }) await expect(page).toHaveNoViolations() }) }) } }) test.describe('Single Select', () => { for (const theme of themes) { test.describe(theme, () => { test('default @vrt', async ({page}) => { await visit(page, { id: 'components-actionlist-features--single-select', globals: { colorScheme: theme, }, }) // Default state expect(await page.screenshot()).toMatchSnapshot(`ActionList.Single Select.${theme}.png`) }) test('axe @aat', async ({page}) => { await visit(page, { id: 'components-actionlist-features--single-select', globals: { colorScheme: theme, }, }) await expect(page).toHaveNoViolations() }) }) } }) test.describe('Text Wrap And Truncation', () => { for (const theme of themes) { test.describe(theme, () => { test('default @vrt', async ({page}) => { await visit(page, { id: 'components-actionlist-features--text-wrap-and-truncation', globals: { colorScheme: theme, }, }) // Default state expect(await page.screenshot()).toMatchSnapshot(`ActionList.Text Wrap And Truncation.${theme}.png`) }) test('axe @aat', async ({page}) => { await visit(page, { id: 'components-actionlist-features--text-wrap-and-truncation', globals: { colorScheme: theme, }, }) await expect(page).toHaveNoViolations() }) }) } }) test.describe('With Avatars', () => { for (const theme of themes) { test.describe(theme, () => { test('default @vrt', async ({page}) => { await visit(page, { id: 'components-actionlist-features--with-avatars', globals: { colorScheme: theme, }, }) // Default state expect(await page.screenshot()).toMatchSnapshot(`ActionList.With Avatars.${theme}.png`) }) test('axe @aat', async ({page}) => { await visit(page, { id: 'components-actionlist-features--with-avatars', globals: { colorScheme: theme, }, }) await expect(page).toHaveNoViolations() }) }) } }) test.describe('With Icons', () => { for (const theme of themes) { test.describe(theme, () => { test('default @vrt', async ({page}) => { await visit(page, { id: 'components-actionlist-features--with-icons', globals: { colorScheme: theme, }, }) // Default state expect(await page.screenshot()).toMatchSnapshot(`ActionList.With Icons.${theme}.png`) }) test('axe @aat', async ({page}) => { await visit(page, { id: 'components-actionlist-features--with-icons', globals: { colorScheme: theme, }, }) await expect(page).toHaveNoViolations() }) }) } }) test.describe('Disabled Multiselect', () => { for (const theme of themes) { test.describe(theme, () => { test('default @vrt', async ({page}) => { await visit(page, { id: 'components-actionlist-features--disabled-multiselect', globals: { colorScheme: theme, }, }) // Default state expect(await page.screenshot()).toMatchSnapshot(`ActionList.Disabled Multiselect.${theme}.png`) }) test('axe @aat', async ({page}) => { await visit(page, { id: 'components-actionlist-features--disabled-multiselect', globals: { colorScheme: theme, }, }) await expect(page).toHaveNoViolations() }) }) } }) test.describe('Disabled Selected Multiselect', () => { for (const theme of themes) { test.describe(theme, () => { test('default @vrt', async ({page}) => { await visit(page, { id: 'components-actionlist-features--disabled-selected-multiselect', globals: { colorScheme: theme, }, }) // Default state expect(await page.screenshot({animations: 'disabled'})).toMatchSnapshot( `ActionList.Disabled Selected Multiselect.${theme}.png`, ) }) test('axe @aat', async ({page}) => { await visit(page, { id: 'components-actionlist-features--disabled-selected-multiselect', globals: { colorScheme: theme, }, }) await expect(page).toHaveNoViolations() }) }) } }) test.describe('Inactive Item', () => { for (const theme of themes) { test.describe(theme, () => { test('default @vrt', async ({page}) => { await visit(page, { id: 'components-actionlist-features--inactive-item', globals: { colorScheme: theme, }, }) // Default state expect(await page.screenshot({animations: 'disabled'})).toMatchSnapshot( `ActionList.Inactive Item.${theme}.png`, ) }) test('axe @aat', async ({page}) => { await visit(page, { id: 'components-actionlist-features--inactive-item', globals: { colorScheme: theme, }, }) await expect(page).toHaveNoViolations() }) }) } }) test.describe('Inactive Multiselect', () => { for (const theme of themes) { test.describe(theme, () => { test('default @vrt', async ({page}) => { await visit(page, { id: 'components-actionlist-features--inactive-multiselect', globals: { colorScheme: theme, }, }) // Default state expect(await page.screenshot({animations: 'disabled'})).toMatchSnapshot( `ActionList.Inactive Multiselect.${theme}.png`, ) }) test('axe @aat', async ({page}) => { await visit(page, { id: 'components-actionlist-features--inactive-multiselect', globals: { colorScheme: theme, }, }) await expect(page).toHaveNoViolations() }) }) } }) })