Skip to content

Commit

Permalink
fix: tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Arucard89 committed Jan 21, 2025
1 parent ea87322 commit 3b1a074
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 18 deletions.
21 changes: 9 additions & 12 deletions src/components/Slider/__tests__/Slider.visual.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,9 @@ import {Slider} from '../Slider';
import type {SliderProps} from '../types';

import {
availableValuesCases,
disabledCases,
hasTooltipCases,
marksCountCases,
marksCases,
sizeCases,
stepCases,
validationStateCases,
Expand All @@ -35,10 +34,9 @@ test.describe('Slider', {tag: '@Slider'}, () => {
size: sizeCases,
disabled: disabledCases,
validationState: validationStateCases,
hasTooltip: hasTooltipCases,
marksCount: marksCountCases,
tooltipDisplay: hasTooltipCases,
marks: marksCases,
step: stepCases,
availableValues: availableValuesCases,
});

await mount(
Expand Down Expand Up @@ -67,8 +65,8 @@ test.describe('Slider', {tag: '@Slider'}, () => {
errorMessage: 'Error message',
},
{
hasTooltip: hasTooltipCases,
marksCount: marksCountCases,
tooltipDisplay: hasTooltipCases,
marks: marksCases,
step: stepCases,
},
);
Expand Down Expand Up @@ -103,10 +101,9 @@ test.describe('Slider', {tag: '@Slider'}, () => {
size: sizeCases,
disabled: disabledCases,
validationState: validationStateCases,
hasTooltip: hasTooltipCases,
marksCount: marksCountCases,
tooltipDisplay: hasTooltipCases,
marks: marksCases,
step: stepCases,
availableValues: availableValuesCases,
});

await mount(
Expand Down Expand Up @@ -135,8 +132,8 @@ test.describe('Slider', {tag: '@Slider'}, () => {
errorMessage: 'Error message',
},
{
hasTooltip: hasTooltipCases,
marksCount: marksCountCases,
tooltipDisplay: hasTooltipCases,
marks: marksCases,
step: stepCases,
},
);
Expand Down
9 changes: 3 additions & 6 deletions src/components/Slider/__tests__/cases.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
import type {Cases, CasesWithName} from '../../../stories/tests-factory/models';
import type {Cases} from '../../../stories/tests-factory/models';
import type {SliderProps} from '../types';

export const sizeCases: Cases<SliderProps['size']> = ['s', 'm', 'l', 'xl'];
export const disabledCases: Cases<SliderProps['disabled']> = [true];
export const validationStateCases: Cases<SliderProps['validationState']> = ['invalid'];
export const hasTooltipCases: Cases<SliderProps['hasTooltip']> = [true];
export const marksCountCases: Cases<SliderProps['marksCount']> = [4];
export const hasTooltipCases: Cases<SliderProps['tooltipDisplay']> = ['on'];
export const marksCases: Cases<SliderProps['marks']> = [4, [10, 20, 50, 55, 65, 80]];
export const stepCases: Cases<SliderProps['step']> = [5];
export const availableValuesCases: CasesWithName<SliderProps['availableValues']> = [
['10-20-50-55-65-80', [10, 20, 50, 55, 65, 80]],
];

0 comments on commit 3b1a074

Please sign in to comment.