diff --git a/src/components/Checkbox/__snapshots__/Checkbox.visual.test.tsx-snapshots/Checkbox-smoke-selection-checked-true-dark-chromium-linux.png b/src/components/Checkbox/__snapshots__/Checkbox.visual.test.tsx-snapshots/Checkbox-smoke-selection-checked-true-dark-chromium-linux.png new file mode 100644 index 0000000000..fbe088222c Binary files /dev/null and b/src/components/Checkbox/__snapshots__/Checkbox.visual.test.tsx-snapshots/Checkbox-smoke-selection-checked-true-dark-chromium-linux.png differ diff --git a/src/components/Checkbox/__snapshots__/Checkbox.visual.test.tsx-snapshots/Checkbox-smoke-selection-checked-true-dark-webkit-linux.png b/src/components/Checkbox/__snapshots__/Checkbox.visual.test.tsx-snapshots/Checkbox-smoke-selection-checked-true-dark-webkit-linux.png new file mode 100644 index 0000000000..7c8f32c26b Binary files /dev/null and b/src/components/Checkbox/__snapshots__/Checkbox.visual.test.tsx-snapshots/Checkbox-smoke-selection-checked-true-dark-webkit-linux.png differ diff --git a/src/components/Checkbox/__snapshots__/Checkbox.visual.test.tsx-snapshots/Checkbox-smoke-selection-checked-true-light-chromium-linux.png b/src/components/Checkbox/__snapshots__/Checkbox.visual.test.tsx-snapshots/Checkbox-smoke-selection-checked-true-light-chromium-linux.png new file mode 100644 index 0000000000..4c459b1201 Binary files /dev/null and b/src/components/Checkbox/__snapshots__/Checkbox.visual.test.tsx-snapshots/Checkbox-smoke-selection-checked-true-light-chromium-linux.png differ diff --git a/src/components/Checkbox/__snapshots__/Checkbox.visual.test.tsx-snapshots/Checkbox-smoke-selection-checked-true-light-webkit-linux.png b/src/components/Checkbox/__snapshots__/Checkbox.visual.test.tsx-snapshots/Checkbox-smoke-selection-checked-true-light-webkit-linux.png new file mode 100644 index 0000000000..6d3630d747 Binary files /dev/null and b/src/components/Checkbox/__snapshots__/Checkbox.visual.test.tsx-snapshots/Checkbox-smoke-selection-checked-true-light-webkit-linux.png differ diff --git a/src/components/Checkbox/__snapshots__/Checkbox.visual.test.tsx-snapshots/Checkbox-smoke-selection-default-dark-chromium-linux.png b/src/components/Checkbox/__snapshots__/Checkbox.visual.test.tsx-snapshots/Checkbox-smoke-selection-default-dark-chromium-linux.png new file mode 100644 index 0000000000..b38058db0e Binary files /dev/null and b/src/components/Checkbox/__snapshots__/Checkbox.visual.test.tsx-snapshots/Checkbox-smoke-selection-default-dark-chromium-linux.png differ diff --git a/src/components/Checkbox/__snapshots__/Checkbox.visual.test.tsx-snapshots/Checkbox-smoke-selection-default-dark-webkit-linux.png b/src/components/Checkbox/__snapshots__/Checkbox.visual.test.tsx-snapshots/Checkbox-smoke-selection-default-dark-webkit-linux.png new file mode 100644 index 0000000000..3015412476 Binary files /dev/null and b/src/components/Checkbox/__snapshots__/Checkbox.visual.test.tsx-snapshots/Checkbox-smoke-selection-default-dark-webkit-linux.png differ diff --git a/src/components/Checkbox/__snapshots__/Checkbox.visual.test.tsx-snapshots/Checkbox-smoke-selection-default-light-chromium-linux.png b/src/components/Checkbox/__snapshots__/Checkbox.visual.test.tsx-snapshots/Checkbox-smoke-selection-default-light-chromium-linux.png new file mode 100644 index 0000000000..a2772870f1 Binary files /dev/null and b/src/components/Checkbox/__snapshots__/Checkbox.visual.test.tsx-snapshots/Checkbox-smoke-selection-default-light-chromium-linux.png differ diff --git a/src/components/Checkbox/__snapshots__/Checkbox.visual.test.tsx-snapshots/Checkbox-smoke-selection-default-light-webkit-linux.png b/src/components/Checkbox/__snapshots__/Checkbox.visual.test.tsx-snapshots/Checkbox-smoke-selection-default-light-webkit-linux.png new file mode 100644 index 0000000000..e662141982 Binary files /dev/null and b/src/components/Checkbox/__snapshots__/Checkbox.visual.test.tsx-snapshots/Checkbox-smoke-selection-default-light-webkit-linux.png differ diff --git a/src/components/Checkbox/__snapshots__/Checkbox.visual.test.tsx-snapshots/Checkbox-smoke-selection-disabled-true-dark-chromium-linux.png b/src/components/Checkbox/__snapshots__/Checkbox.visual.test.tsx-snapshots/Checkbox-smoke-selection-disabled-true-dark-chromium-linux.png new file mode 100644 index 0000000000..68c05f47ea Binary files /dev/null and b/src/components/Checkbox/__snapshots__/Checkbox.visual.test.tsx-snapshots/Checkbox-smoke-selection-disabled-true-dark-chromium-linux.png differ diff --git a/src/components/Checkbox/__snapshots__/Checkbox.visual.test.tsx-snapshots/Checkbox-smoke-selection-disabled-true-dark-webkit-linux.png b/src/components/Checkbox/__snapshots__/Checkbox.visual.test.tsx-snapshots/Checkbox-smoke-selection-disabled-true-dark-webkit-linux.png new file mode 100644 index 0000000000..d4e3ddb6dd Binary files /dev/null and b/src/components/Checkbox/__snapshots__/Checkbox.visual.test.tsx-snapshots/Checkbox-smoke-selection-disabled-true-dark-webkit-linux.png differ diff --git a/src/components/Checkbox/__snapshots__/Checkbox.visual.test.tsx-snapshots/Checkbox-smoke-selection-disabled-true-light-chromium-linux.png b/src/components/Checkbox/__snapshots__/Checkbox.visual.test.tsx-snapshots/Checkbox-smoke-selection-disabled-true-light-chromium-linux.png new file mode 100644 index 0000000000..cff72feb76 Binary files /dev/null and b/src/components/Checkbox/__snapshots__/Checkbox.visual.test.tsx-snapshots/Checkbox-smoke-selection-disabled-true-light-chromium-linux.png differ diff --git a/src/components/Checkbox/__snapshots__/Checkbox.visual.test.tsx-snapshots/Checkbox-smoke-selection-disabled-true-light-webkit-linux.png b/src/components/Checkbox/__snapshots__/Checkbox.visual.test.tsx-snapshots/Checkbox-smoke-selection-disabled-true-light-webkit-linux.png new file mode 100644 index 0000000000..74c2776080 Binary files /dev/null and b/src/components/Checkbox/__snapshots__/Checkbox.visual.test.tsx-snapshots/Checkbox-smoke-selection-disabled-true-light-webkit-linux.png differ diff --git a/src/components/Checkbox/__snapshots__/Checkbox.visual.test.tsx-snapshots/Checkbox-smoke-selection-indeterminate-true-dark-chromium-linux.png b/src/components/Checkbox/__snapshots__/Checkbox.visual.test.tsx-snapshots/Checkbox-smoke-selection-indeterminate-true-dark-chromium-linux.png new file mode 100644 index 0000000000..9a15a0abbd Binary files /dev/null and b/src/components/Checkbox/__snapshots__/Checkbox.visual.test.tsx-snapshots/Checkbox-smoke-selection-indeterminate-true-dark-chromium-linux.png differ diff --git a/src/components/Checkbox/__snapshots__/Checkbox.visual.test.tsx-snapshots/Checkbox-smoke-selection-indeterminate-true-dark-webkit-linux.png b/src/components/Checkbox/__snapshots__/Checkbox.visual.test.tsx-snapshots/Checkbox-smoke-selection-indeterminate-true-dark-webkit-linux.png new file mode 100644 index 0000000000..21f5de0100 Binary files /dev/null and b/src/components/Checkbox/__snapshots__/Checkbox.visual.test.tsx-snapshots/Checkbox-smoke-selection-indeterminate-true-dark-webkit-linux.png differ diff --git a/src/components/Checkbox/__snapshots__/Checkbox.visual.test.tsx-snapshots/Checkbox-smoke-selection-indeterminate-true-light-chromium-linux.png b/src/components/Checkbox/__snapshots__/Checkbox.visual.test.tsx-snapshots/Checkbox-smoke-selection-indeterminate-true-light-chromium-linux.png new file mode 100644 index 0000000000..de6dbf8ab0 Binary files /dev/null and b/src/components/Checkbox/__snapshots__/Checkbox.visual.test.tsx-snapshots/Checkbox-smoke-selection-indeterminate-true-light-chromium-linux.png differ diff --git a/src/components/Checkbox/__snapshots__/Checkbox.visual.test.tsx-snapshots/Checkbox-smoke-selection-indeterminate-true-light-webkit-linux.png b/src/components/Checkbox/__snapshots__/Checkbox.visual.test.tsx-snapshots/Checkbox-smoke-selection-indeterminate-true-light-webkit-linux.png new file mode 100644 index 0000000000..b91a21fdb4 Binary files /dev/null and b/src/components/Checkbox/__snapshots__/Checkbox.visual.test.tsx-snapshots/Checkbox-smoke-selection-indeterminate-true-light-webkit-linux.png differ diff --git a/src/components/Checkbox/__snapshots__/Checkbox.visual.test.tsx-snapshots/Checkbox-smoke-selection-size-l-dark-chromium-linux.png b/src/components/Checkbox/__snapshots__/Checkbox.visual.test.tsx-snapshots/Checkbox-smoke-selection-size-l-dark-chromium-linux.png new file mode 100644 index 0000000000..7472398b64 Binary files /dev/null and b/src/components/Checkbox/__snapshots__/Checkbox.visual.test.tsx-snapshots/Checkbox-smoke-selection-size-l-dark-chromium-linux.png differ diff --git a/src/components/Checkbox/__snapshots__/Checkbox.visual.test.tsx-snapshots/Checkbox-smoke-selection-size-l-dark-webkit-linux.png b/src/components/Checkbox/__snapshots__/Checkbox.visual.test.tsx-snapshots/Checkbox-smoke-selection-size-l-dark-webkit-linux.png new file mode 100644 index 0000000000..d2be8552bd Binary files /dev/null and b/src/components/Checkbox/__snapshots__/Checkbox.visual.test.tsx-snapshots/Checkbox-smoke-selection-size-l-dark-webkit-linux.png differ diff --git a/src/components/Checkbox/__snapshots__/Checkbox.visual.test.tsx-snapshots/Checkbox-smoke-selection-size-l-light-chromium-linux.png b/src/components/Checkbox/__snapshots__/Checkbox.visual.test.tsx-snapshots/Checkbox-smoke-selection-size-l-light-chromium-linux.png new file mode 100644 index 0000000000..8406f23b08 Binary files /dev/null and b/src/components/Checkbox/__snapshots__/Checkbox.visual.test.tsx-snapshots/Checkbox-smoke-selection-size-l-light-chromium-linux.png differ diff --git a/src/components/Checkbox/__snapshots__/Checkbox.visual.test.tsx-snapshots/Checkbox-smoke-selection-size-l-light-webkit-linux.png b/src/components/Checkbox/__snapshots__/Checkbox.visual.test.tsx-snapshots/Checkbox-smoke-selection-size-l-light-webkit-linux.png new file mode 100644 index 0000000000..dedf997921 Binary files /dev/null and b/src/components/Checkbox/__snapshots__/Checkbox.visual.test.tsx-snapshots/Checkbox-smoke-selection-size-l-light-webkit-linux.png differ diff --git a/src/components/Checkbox/__snapshots__/Checkbox.visual.test.tsx-snapshots/Checkbox-smoke-selection-size-m-dark-chromium-linux.png b/src/components/Checkbox/__snapshots__/Checkbox.visual.test.tsx-snapshots/Checkbox-smoke-selection-size-m-dark-chromium-linux.png new file mode 100644 index 0000000000..b38058db0e Binary files /dev/null and b/src/components/Checkbox/__snapshots__/Checkbox.visual.test.tsx-snapshots/Checkbox-smoke-selection-size-m-dark-chromium-linux.png differ diff --git a/src/components/Checkbox/__snapshots__/Checkbox.visual.test.tsx-snapshots/Checkbox-smoke-selection-size-m-dark-webkit-linux.png b/src/components/Checkbox/__snapshots__/Checkbox.visual.test.tsx-snapshots/Checkbox-smoke-selection-size-m-dark-webkit-linux.png new file mode 100644 index 0000000000..3015412476 Binary files /dev/null and b/src/components/Checkbox/__snapshots__/Checkbox.visual.test.tsx-snapshots/Checkbox-smoke-selection-size-m-dark-webkit-linux.png differ diff --git a/src/components/Checkbox/__snapshots__/Checkbox.visual.test.tsx-snapshots/Checkbox-smoke-selection-size-m-light-chromium-linux.png b/src/components/Checkbox/__snapshots__/Checkbox.visual.test.tsx-snapshots/Checkbox-smoke-selection-size-m-light-chromium-linux.png new file mode 100644 index 0000000000..a2772870f1 Binary files /dev/null and b/src/components/Checkbox/__snapshots__/Checkbox.visual.test.tsx-snapshots/Checkbox-smoke-selection-size-m-light-chromium-linux.png differ diff --git a/src/components/Checkbox/__snapshots__/Checkbox.visual.test.tsx-snapshots/Checkbox-smoke-selection-size-m-light-webkit-linux.png b/src/components/Checkbox/__snapshots__/Checkbox.visual.test.tsx-snapshots/Checkbox-smoke-selection-size-m-light-webkit-linux.png new file mode 100644 index 0000000000..e662141982 Binary files /dev/null and b/src/components/Checkbox/__snapshots__/Checkbox.visual.test.tsx-snapshots/Checkbox-smoke-selection-size-m-light-webkit-linux.png differ diff --git a/src/components/Checkbox/__tests__/Checkbox.visual.test.tsx b/src/components/Checkbox/__tests__/Checkbox.visual.test.tsx new file mode 100644 index 0000000000..f75ec74e69 --- /dev/null +++ b/src/components/Checkbox/__tests__/Checkbox.visual.test.tsx @@ -0,0 +1,36 @@ +import React from 'react'; + +import {test} from '~playwright/core'; + +import {createSmokeScenarios} from '../../../stories/tests-factory/create-smoke-scenarios'; +import type {CheckboxProps} from '../Checkbox'; +import {Checkbox} from '../Checkbox'; + +import {checkedCases, disabledCases, indeterminateCases, sizeCases} from './cases'; + +test.describe('Checkbox', {tag: '@Checkbox'}, () => { + const defaultProps: CheckboxProps = { + name: '', + value: '', + content: 'Checkbox label', + }; + + createSmokeScenarios( + defaultProps, + { + size: sizeCases, + disabled: disabledCases, + checked: checkedCases, + indeterminate: indeterminateCases, + }, + { + scenarioName: 'selection', + }, + ).forEach(([title, details, props]) => { + test(title, details, async ({mount, expectScreenshot}) => { + await mount(); + + await expectScreenshot(); + }); + }); +}); diff --git a/src/components/Checkbox/__tests__/cases.tsx b/src/components/Checkbox/__tests__/cases.tsx new file mode 100644 index 0000000000..1ee6b3cc97 --- /dev/null +++ b/src/components/Checkbox/__tests__/cases.tsx @@ -0,0 +1,10 @@ +import type {Cases} from '../../../stories/tests-factory/models'; +import type {CheckboxProps} from '../Checkbox'; + +export const sizeCases: Array = ['m', 'l']; + +export const disabledCases: Cases = [true]; + +export const checkedCases: Cases = [true]; + +export const indeterminateCases: Cases = [true];