Skip to content

Commit

Permalink
test(Skeleton): update snapshots
Browse files Browse the repository at this point in the history
  • Loading branch information
itwillwork committed Dec 25, 2024
1 parent ef036d7 commit 057c25b
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 15 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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.
39 changes: 24 additions & 15 deletions src/components/Skeleton/__tests__/Skeleton.visual.test.tsx
Original file line number Diff line number Diff line change
@@ -1,25 +1,34 @@
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 {SkeletonProps} from '../Skeleton';
import {Skeleton} from '../Skeleton';

test.describe('Skeleton', {tag: '@Skeleton'}, () => {
const defaultProps: SkeletonProps = {
className: '',
style: {
width: '30px',
height: '30px',
},
};
smokeTest('', async ({mount, expectScreenshot}) => {
const defaultProps: SkeletonProps = {
className: '',
style: {
width: '30px',
height: '30px',
},
};

const smokeScenarios = createSmokeScenarios(defaultProps, {});

createSmokeScenarios(defaultProps, {}).forEach(([title, details, props]) => {
test(title, details, async ({mount, expectScreenshot}) => {
await mount(<Skeleton {...props} />);
await mount(
<div style={{width: 400}}>
{smokeScenarios.map(([title, props]) => (
<div key={title}>
<h4>{title}</h4>
<div>
<Skeleton {...props} />
</div>
</div>
))}
</div>,
);

await expectScreenshot();
});
await expectScreenshot({});
});
});

0 comments on commit 057c25b

Please sign in to comment.