diff --git a/src/components/DefinitionList/__snapshots__/DefinitionList.visual.test.tsx-snapshots/DefinitionList-render-story-Default-dark-chromium-linux.png b/src/components/DefinitionList/__snapshots__/DefinitionList.visual.test.tsx-snapshots/DefinitionList-render-story-Default-dark-chromium-linux.png new file mode 100644 index 0000000000..32e82be4a9 Binary files /dev/null and b/src/components/DefinitionList/__snapshots__/DefinitionList.visual.test.tsx-snapshots/DefinitionList-render-story-Default-dark-chromium-linux.png differ diff --git a/src/components/DefinitionList/__snapshots__/DefinitionList.visual.test.tsx-snapshots/DefinitionList-render-story-Default-light-chromium-linux.png b/src/components/DefinitionList/__snapshots__/DefinitionList.visual.test.tsx-snapshots/DefinitionList-render-story-Default-light-chromium-linux.png new file mode 100644 index 0000000000..334e945eeb Binary files /dev/null and b/src/components/DefinitionList/__snapshots__/DefinitionList.visual.test.tsx-snapshots/DefinitionList-render-story-Default-light-chromium-linux.png differ diff --git a/src/components/DefinitionList/__snapshots__/DefinitionList.visual.test.tsx-snapshots/DefinitionList-smoke-default-light-chromium-linux.png b/src/components/DefinitionList/__snapshots__/DefinitionList.visual.test.tsx-snapshots/DefinitionList-smoke-default-light-chromium-linux.png new file mode 100644 index 0000000000..f95c2eb5d5 Binary files /dev/null and b/src/components/DefinitionList/__snapshots__/DefinitionList.visual.test.tsx-snapshots/DefinitionList-smoke-default-light-chromium-linux.png differ diff --git a/src/components/DefinitionList/__snapshots__/DefinitionList.visual.test.tsx-snapshots/DefinitionList-smoke-direction-horizontal-light-chromium-linux.png b/src/components/DefinitionList/__snapshots__/DefinitionList.visual.test.tsx-snapshots/DefinitionList-smoke-direction-horizontal-light-chromium-linux.png new file mode 100644 index 0000000000..80573595b2 Binary files /dev/null and b/src/components/DefinitionList/__snapshots__/DefinitionList.visual.test.tsx-snapshots/DefinitionList-smoke-direction-horizontal-light-chromium-linux.png differ diff --git a/src/components/DefinitionList/__snapshots__/DefinitionList.visual.test.tsx-snapshots/DefinitionList-smoke-direction-vertical-light-chromium-linux.png b/src/components/DefinitionList/__snapshots__/DefinitionList.visual.test.tsx-snapshots/DefinitionList-smoke-direction-vertical-light-chromium-linux.png new file mode 100644 index 0000000000..5fd519d0f1 Binary files /dev/null and b/src/components/DefinitionList/__snapshots__/DefinitionList.visual.test.tsx-snapshots/DefinitionList-smoke-direction-vertical-light-chromium-linux.png differ diff --git a/src/components/DefinitionList/__snapshots__/DefinitionList.visual.test.tsx-snapshots/DefinitionList-smoke-responsive-contentMaxWidth-100-light-chromium-linux.png b/src/components/DefinitionList/__snapshots__/DefinitionList.visual.test.tsx-snapshots/DefinitionList-smoke-responsive-contentMaxWidth-100-light-chromium-linux.png new file mode 100644 index 0000000000..e1443f4bbc Binary files /dev/null and b/src/components/DefinitionList/__snapshots__/DefinitionList.visual.test.tsx-snapshots/DefinitionList-smoke-responsive-contentMaxWidth-100-light-chromium-linux.png differ diff --git a/src/components/DefinitionList/__snapshots__/DefinitionList.visual.test.tsx-snapshots/DefinitionList-smoke-responsive-default-light-chromium-linux.png b/src/components/DefinitionList/__snapshots__/DefinitionList.visual.test.tsx-snapshots/DefinitionList-smoke-responsive-default-light-chromium-linux.png new file mode 100644 index 0000000000..8e156c5462 Binary files /dev/null and b/src/components/DefinitionList/__snapshots__/DefinitionList.visual.test.tsx-snapshots/DefinitionList-smoke-responsive-default-light-chromium-linux.png differ diff --git a/src/components/DefinitionList/__snapshots__/DefinitionList.visual.test.tsx-snapshots/DefinitionList-smoke-responsive-nameMaxWidth-100-light-chromium-linux.png b/src/components/DefinitionList/__snapshots__/DefinitionList.visual.test.tsx-snapshots/DefinitionList-smoke-responsive-nameMaxWidth-100-light-chromium-linux.png new file mode 100644 index 0000000000..98afcbc73e Binary files /dev/null and b/src/components/DefinitionList/__snapshots__/DefinitionList.visual.test.tsx-snapshots/DefinitionList-smoke-responsive-nameMaxWidth-100-light-chromium-linux.png differ diff --git a/src/components/DefinitionList/__tests__/DefinitionList.visual.test.tsx b/src/components/DefinitionList/__tests__/DefinitionList.visual.test.tsx new file mode 100644 index 0000000000..4454533d8a --- /dev/null +++ b/src/components/DefinitionList/__tests__/DefinitionList.visual.test.tsx @@ -0,0 +1,69 @@ +import {smokeTest, test} from '~playwright/core'; + +import {createSmokeScenarios} from '../../../stories/tests-factory/create-smoke-scenarios'; +import type {DefinitionListProps} from '../types'; + +import {DefinitionListStories} from './stories'; + +test.describe('DefinitionList', {tag: '@DefinitionList'}, () => { + test('render story ', async ({mount, expectScreenshot}) => { + await mount(); + + await expectScreenshot(); + }); + + createSmokeScenarios>( + {}, + { + direction: ['vertical', 'horizontal'], + }, + ).forEach(([title, props]) => { + smokeTest(title, async ({mount, expectScreenshot}) => { + await mount( +
+

{title}

+ +
, + ); + + await expectScreenshot({ + themes: ['light'], + }); + }); + }); + + createSmokeScenarios>( + { + responsive: true, + }, + { + nameMaxWidth: [100], + contentMaxWidth: [100], + }, + { + scenarioName: 'responsive', + }, + ).forEach(([title, props]) => { + smokeTest(title, async ({mount, page, expectScreenshot}) => { + const size = page.viewportSize(); + if (size) { + await page.setViewportSize({ + width: 1000, + height: size.height, + }); + } + + await mount( +
+

{title}

+ +
, + {width: 'auto'}, + ); + + await expectScreenshot({ + themes: ['light'], + }); + }); + }); +}); diff --git a/src/components/DefinitionList/__tests__/stories.ts b/src/components/DefinitionList/__tests__/stories.ts new file mode 100644 index 0000000000..edc0615e88 --- /dev/null +++ b/src/components/DefinitionList/__tests__/stories.ts @@ -0,0 +1,5 @@ +import {composeStories} from '@storybook/react'; + +import * as CSFStories from '../__stories__/DefinitionList.stories'; + +export const DefinitionListStories = composeStories(CSFStories);