-
Notifications
You must be signed in to change notification settings - Fork 99
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ef036d7
commit 057c25b
Showing
7 changed files
with
24 additions
and
15 deletions.
There are no files selected for viewing
Binary file added
BIN
+4.74 KB
...ots__/Skeleton.visual.test.tsx-snapshots/Skeleton-smoke-dark-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed
BIN
-1.42 KB
...eleton.visual.test.tsx-snapshots/Skeleton-smoke-default-dark-chromium-linux.png
Binary file not shown.
Binary file removed
BIN
-849 Bytes
...Skeleton.visual.test.tsx-snapshots/Skeleton-smoke-default-dark-webkit-linux.png
Binary file not shown.
Binary file removed
BIN
-1.15 KB
...leton.visual.test.tsx-snapshots/Skeleton-smoke-default-light-chromium-linux.png
Binary file not shown.
Binary file removed
BIN
-737 Bytes
...keleton.visual.test.tsx-snapshots/Skeleton-smoke-default-light-webkit-linux.png
Binary file not shown.
Binary file added
BIN
+4.31 KB
...ts__/Skeleton.visual.test.tsx-snapshots/Skeleton-smoke-light-chromium-linux.png
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
39
src/components/Skeleton/__tests__/Skeleton.visual.test.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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({}); | ||
}); | ||
}); |