Skip to content

Commit

Permalink
test(Slider): improve visual tests
Browse files Browse the repository at this point in the history
  • Loading branch information
itwillwork committed Dec 27, 2024
1 parent 1f97423 commit 399b121
Show file tree
Hide file tree
Showing 101 changed files with 24 additions and 12 deletions.
36 changes: 24 additions & 12 deletions src/components/Slider/__tests__/Slider.visual.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,11 @@ test.describe('Slider', {tag: '@Slider'}, () => {
marksCount: marksCountCases,
step: stepCases,
},
{
scenarioName: 'with error',
},
).forEach(([title, details, props]) => {
test(`with error ${title}`, details, async ({mount, expectScreenshot}) => {
test(title, details, async ({mount, expectScreenshot}) => {
await mount(
<div style={{width: 300, height: 200}}>
<Slider {...props} />
Expand All @@ -72,16 +75,22 @@ test.describe('Slider', {tag: '@Slider'}, () => {
max: 100,
};

createSmokeScenarios(defaultRangeProps, {
size: sizeCases,
disabled: disabledCases,
validationState: validationStateCases,
hasTooltip: hasTooltipCases,
marksCount: marksCountCases,
step: stepCases,
availableValues: availableValuesCases,
}).forEach(([title, details, props]) => {
test(`range ${title}`, details, async ({mount, expectScreenshot}) => {
createSmokeScenarios(
defaultRangeProps,
{
size: sizeCases,
disabled: disabledCases,
validationState: validationStateCases,
hasTooltip: hasTooltipCases,
marksCount: marksCountCases,
step: stepCases,
availableValues: availableValuesCases,
},
{
scenarioName: 'range',
},
).forEach(([title, details, props]) => {
test(title, details, async ({mount, expectScreenshot}) => {
await mount(
<div style={{width: 300, height: 50}}>
<Slider {...props} />
Expand All @@ -102,8 +111,11 @@ test.describe('Slider', {tag: '@Slider'}, () => {
marksCount: marksCountCases,
step: stepCases,
},
{
scenarioName: 'range with error',
},
).forEach(([title, details, props]) => {
test(`range with error ${title}`, details, async ({mount, expectScreenshot}) => {
test(title, details, async ({mount, expectScreenshot}) => {
await mount(
<div style={{width: 300, height: 200}}>
<Slider {...props} />
Expand Down

0 comments on commit 399b121

Please sign in to comment.