Skip to content

Commit

Permalink
test(Divider): update snapshots
Browse files Browse the repository at this point in the history
  • Loading branch information
itwillwork committed Dec 25, 2024
1 parent 75507c7 commit 9661145
Show file tree
Hide file tree
Showing 14 changed files with 21 additions and 8 deletions.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
29 changes: 21 additions & 8 deletions src/components/Divider/__tests__/Divider.visual.test.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';

import {test} from '~playwright/core';
import {smokeTest, test} from '~playwright/core';

import {createSmokeScenarios} from '../../../stories/tests-factory/create-smoke-scenarios';
import type {DividerProps} from '../Divider';
Expand All @@ -9,15 +9,28 @@ import {orientationCases} from './cases';
import {ListWithDivider} from './helpers';

test.describe('Divider', {tag: '@Divider'}, () => {
const defaultProps: DividerProps = {};
smokeTest('smoke', async ({mount, expectScreenshot}) => {
const defaultProps: DividerProps = {};

createSmokeScenarios(defaultProps, {
orientation: orientationCases,
}).forEach(([title, details, props]) => {
test(title, details, async ({mount, expectScreenshot}) => {
await mount(<ListWithDivider {...props} />);
const smokeScenarios = createSmokeScenarios(defaultProps, {
orientation: orientationCases,
});

await mount(
<div>
{smokeScenarios.map(([title, props]) => (
<div key={title}>
<h4>{title}</h4>
<div>
<ListWithDivider {...props} />
</div>
</div>
))}
</div>,
);

await expectScreenshot();
await expectScreenshot({
themes: ['light'],
});
});
});

0 comments on commit 9661145

Please sign in to comment.