Skip to content

Commit

Permalink
test(ControlLabel): update snapshots
Browse files Browse the repository at this point in the history
  • Loading branch information
itwillwork committed Dec 25, 2024
1 parent 37b095c commit e4a6da9
Show file tree
Hide file tree
Showing 22 changed files with 25 additions and 12 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.
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.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
37 changes: 25 additions & 12 deletions src/components/ControlLabel/__tests__/ControlLabel.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 {ControlLabel} from '../ControlLabel';
Expand All @@ -9,19 +9,32 @@ import type {Props} from '../types';
import {disabledCases, sizeCases, titleCases} from './cases';

test.describe('ControlLabel', {tag: '@ControlLabel'}, () => {
const defaultProps: Props = {
control: <div>control</div>,
};
smokeTest('smoke', async ({mount, expectScreenshot}) => {
const defaultProps: Props = {
control: <div>control</div>,
};

createSmokeScenarios(defaultProps, {
size: sizeCases,
title: titleCases,
disabled: disabledCases,
}).forEach(([title, details, props]) => {
test(title, details, async ({mount, expectScreenshot}) => {
await mount(<ControlLabel {...props} />);
const smokeScenarios = createSmokeScenarios(defaultProps, {
size: sizeCases,
title: titleCases,
disabled: disabledCases,
});

await mount(
<div style={{width: 400}}>
{smokeScenarios.map(([title, props]) => (
<div key={title}>
<h4>{title}</h4>
<div>
<ControlLabel {...props} />
</div>
</div>
))}
</div>,
);

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

0 comments on commit e4a6da9

Please sign in to comment.