diff --git a/src/components/ActionTooltip/__snapshots__/ActionTooltip.visual.test.tsx-snapshots/ActionTooltip-smoke-default-light-chromium-linux.png b/src/components/ActionTooltip/__snapshots__/ActionTooltip.visual.test.tsx-snapshots/ActionTooltip-smoke-default-light-chromium-linux.png new file mode 100644 index 0000000000..391c94b417 Binary files /dev/null and b/src/components/ActionTooltip/__snapshots__/ActionTooltip.visual.test.tsx-snapshots/ActionTooltip-smoke-default-light-chromium-linux.png differ diff --git a/src/components/ActionTooltip/__snapshots__/ActionTooltip.visual.test.tsx-snapshots/ActionTooltip-smoke-placement-auto-end-light-chromium-linux.png b/src/components/ActionTooltip/__snapshots__/ActionTooltip.visual.test.tsx-snapshots/ActionTooltip-smoke-placement-auto-end-light-chromium-linux.png new file mode 100644 index 0000000000..f2a962fc9e Binary files /dev/null and b/src/components/ActionTooltip/__snapshots__/ActionTooltip.visual.test.tsx-snapshots/ActionTooltip-smoke-placement-auto-end-light-chromium-linux.png differ diff --git a/src/components/ActionTooltip/__snapshots__/ActionTooltip.visual.test.tsx-snapshots/ActionTooltip-smoke-placement-auto-light-chromium-linux.png b/src/components/ActionTooltip/__snapshots__/ActionTooltip.visual.test.tsx-snapshots/ActionTooltip-smoke-placement-auto-light-chromium-linux.png new file mode 100644 index 0000000000..abfc6d8556 Binary files /dev/null and b/src/components/ActionTooltip/__snapshots__/ActionTooltip.visual.test.tsx-snapshots/ActionTooltip-smoke-placement-auto-light-chromium-linux.png differ diff --git a/src/components/ActionTooltip/__snapshots__/ActionTooltip.visual.test.tsx-snapshots/ActionTooltip-smoke-placement-auto-start-light-chromium-linux.png b/src/components/ActionTooltip/__snapshots__/ActionTooltip.visual.test.tsx-snapshots/ActionTooltip-smoke-placement-auto-start-light-chromium-linux.png new file mode 100644 index 0000000000..51ab11466f Binary files /dev/null and b/src/components/ActionTooltip/__snapshots__/ActionTooltip.visual.test.tsx-snapshots/ActionTooltip-smoke-placement-auto-start-light-chromium-linux.png differ diff --git a/src/components/ActionTooltip/__snapshots__/ActionTooltip.visual.test.tsx-snapshots/ActionTooltip-smoke-placement-bottom-end-light-chromium-linux.png b/src/components/ActionTooltip/__snapshots__/ActionTooltip.visual.test.tsx-snapshots/ActionTooltip-smoke-placement-bottom-end-light-chromium-linux.png new file mode 100644 index 0000000000..0db5b20e0d Binary files /dev/null and b/src/components/ActionTooltip/__snapshots__/ActionTooltip.visual.test.tsx-snapshots/ActionTooltip-smoke-placement-bottom-end-light-chromium-linux.png differ diff --git a/src/components/ActionTooltip/__snapshots__/ActionTooltip.visual.test.tsx-snapshots/ActionTooltip-smoke-placement-bottom-light-chromium-linux.png b/src/components/ActionTooltip/__snapshots__/ActionTooltip.visual.test.tsx-snapshots/ActionTooltip-smoke-placement-bottom-light-chromium-linux.png new file mode 100644 index 0000000000..af6217eb5a Binary files /dev/null and b/src/components/ActionTooltip/__snapshots__/ActionTooltip.visual.test.tsx-snapshots/ActionTooltip-smoke-placement-bottom-light-chromium-linux.png differ diff --git a/src/components/ActionTooltip/__snapshots__/ActionTooltip.visual.test.tsx-snapshots/ActionTooltip-smoke-placement-bottom-start-light-chromium-linux.png b/src/components/ActionTooltip/__snapshots__/ActionTooltip.visual.test.tsx-snapshots/ActionTooltip-smoke-placement-bottom-start-light-chromium-linux.png new file mode 100644 index 0000000000..cf59c40ce3 Binary files /dev/null and b/src/components/ActionTooltip/__snapshots__/ActionTooltip.visual.test.tsx-snapshots/ActionTooltip-smoke-placement-bottom-start-light-chromium-linux.png differ diff --git a/src/components/ActionTooltip/__snapshots__/ActionTooltip.visual.test.tsx-snapshots/ActionTooltip-smoke-placement-left-end-light-chromium-linux.png b/src/components/ActionTooltip/__snapshots__/ActionTooltip.visual.test.tsx-snapshots/ActionTooltip-smoke-placement-left-end-light-chromium-linux.png new file mode 100644 index 0000000000..a724ab3239 Binary files /dev/null and b/src/components/ActionTooltip/__snapshots__/ActionTooltip.visual.test.tsx-snapshots/ActionTooltip-smoke-placement-left-end-light-chromium-linux.png differ diff --git a/src/components/ActionTooltip/__snapshots__/ActionTooltip.visual.test.tsx-snapshots/ActionTooltip-smoke-placement-left-light-chromium-linux.png b/src/components/ActionTooltip/__snapshots__/ActionTooltip.visual.test.tsx-snapshots/ActionTooltip-smoke-placement-left-light-chromium-linux.png new file mode 100644 index 0000000000..ae11008245 Binary files /dev/null and b/src/components/ActionTooltip/__snapshots__/ActionTooltip.visual.test.tsx-snapshots/ActionTooltip-smoke-placement-left-light-chromium-linux.png differ diff --git a/src/components/ActionTooltip/__snapshots__/ActionTooltip.visual.test.tsx-snapshots/ActionTooltip-smoke-placement-left-start-light-chromium-linux.png b/src/components/ActionTooltip/__snapshots__/ActionTooltip.visual.test.tsx-snapshots/ActionTooltip-smoke-placement-left-start-light-chromium-linux.png new file mode 100644 index 0000000000..cda33cb6fc Binary files /dev/null and b/src/components/ActionTooltip/__snapshots__/ActionTooltip.visual.test.tsx-snapshots/ActionTooltip-smoke-placement-left-start-light-chromium-linux.png differ diff --git a/src/components/ActionTooltip/__snapshots__/ActionTooltip.visual.test.tsx-snapshots/ActionTooltip-smoke-placement-right-end-light-chromium-linux.png b/src/components/ActionTooltip/__snapshots__/ActionTooltip.visual.test.tsx-snapshots/ActionTooltip-smoke-placement-right-end-light-chromium-linux.png new file mode 100644 index 0000000000..0ade73c562 Binary files /dev/null and b/src/components/ActionTooltip/__snapshots__/ActionTooltip.visual.test.tsx-snapshots/ActionTooltip-smoke-placement-right-end-light-chromium-linux.png differ diff --git a/src/components/ActionTooltip/__snapshots__/ActionTooltip.visual.test.tsx-snapshots/ActionTooltip-smoke-placement-right-light-chromium-linux.png b/src/components/ActionTooltip/__snapshots__/ActionTooltip.visual.test.tsx-snapshots/ActionTooltip-smoke-placement-right-light-chromium-linux.png new file mode 100644 index 0000000000..b32ef197c1 Binary files /dev/null and b/src/components/ActionTooltip/__snapshots__/ActionTooltip.visual.test.tsx-snapshots/ActionTooltip-smoke-placement-right-light-chromium-linux.png differ diff --git a/src/components/ActionTooltip/__snapshots__/ActionTooltip.visual.test.tsx-snapshots/ActionTooltip-smoke-placement-right-start-light-chromium-linux.png b/src/components/ActionTooltip/__snapshots__/ActionTooltip.visual.test.tsx-snapshots/ActionTooltip-smoke-placement-right-start-light-chromium-linux.png new file mode 100644 index 0000000000..2df92256b1 Binary files /dev/null and b/src/components/ActionTooltip/__snapshots__/ActionTooltip.visual.test.tsx-snapshots/ActionTooltip-smoke-placement-right-start-light-chromium-linux.png differ diff --git a/src/components/ActionTooltip/__snapshots__/ActionTooltip.visual.test.tsx-snapshots/ActionTooltip-smoke-placement-top-end-light-chromium-linux.png b/src/components/ActionTooltip/__snapshots__/ActionTooltip.visual.test.tsx-snapshots/ActionTooltip-smoke-placement-top-end-light-chromium-linux.png new file mode 100644 index 0000000000..bf70117210 Binary files /dev/null and b/src/components/ActionTooltip/__snapshots__/ActionTooltip.visual.test.tsx-snapshots/ActionTooltip-smoke-placement-top-end-light-chromium-linux.png differ diff --git a/src/components/ActionTooltip/__snapshots__/ActionTooltip.visual.test.tsx-snapshots/ActionTooltip-smoke-placement-top-light-chromium-linux.png b/src/components/ActionTooltip/__snapshots__/ActionTooltip.visual.test.tsx-snapshots/ActionTooltip-smoke-placement-top-light-chromium-linux.png new file mode 100644 index 0000000000..cd8797636a Binary files /dev/null and b/src/components/ActionTooltip/__snapshots__/ActionTooltip.visual.test.tsx-snapshots/ActionTooltip-smoke-placement-top-light-chromium-linux.png differ diff --git a/src/components/ActionTooltip/__snapshots__/ActionTooltip.visual.test.tsx-snapshots/ActionTooltip-smoke-placement-top-start-light-chromium-linux.png b/src/components/ActionTooltip/__snapshots__/ActionTooltip.visual.test.tsx-snapshots/ActionTooltip-smoke-placement-top-start-light-chromium-linux.png new file mode 100644 index 0000000000..948c0cb4a3 Binary files /dev/null and b/src/components/ActionTooltip/__snapshots__/ActionTooltip.visual.test.tsx-snapshots/ActionTooltip-smoke-placement-top-start-light-chromium-linux.png differ diff --git a/src/components/ActionTooltip/__tests__/ActionTooltip.visual.test.tsx b/src/components/ActionTooltip/__tests__/ActionTooltip.visual.test.tsx new file mode 100644 index 0000000000..a737c1ddfe --- /dev/null +++ b/src/components/ActionTooltip/__tests__/ActionTooltip.visual.test.tsx @@ -0,0 +1,66 @@ +import {expect} from '@playwright/experimental-ct-react'; + +import {smokeTest, test} from '~playwright/core'; + +import {createSmokeScenarios} from '../../../stories/tests-factory/create-smoke-scenarios'; +import type {ActionTooltipProps} from '../ActionTooltip'; +import {ActionTooltip} from '../ActionTooltip'; + +import {placementCases} from './cases'; + +test.describe('ActionTooltip', {tag: '@ActionTooltip'}, () => { + const defaultProps: ActionTooltipProps = { + title: 'Title', + hotkey: 'mod+a', + description: 'Description', + children:
trigger
, + }; + + const smokeScenarios = createSmokeScenarios(defaultProps, { + placement: placementCases, + }); + + smokeScenarios.forEach(([title, props]) => { + smokeTest(title, async ({mount, page, expectScreenshot}) => { + const root = await mount( +
+

{title}

+
+
+ +
+ trigger block +
+
+
+
+
, + ); + + await root.getByTestId('trigger').hover(); + await expect(page.locator("[role='tooltip']")).toBeVisible({timeout: 1000}); + + await expectScreenshot({ + themes: ['light'], + }); + }); + }); +}); diff --git a/src/components/ActionTooltip/__tests__/cases.tsx b/src/components/ActionTooltip/__tests__/cases.tsx new file mode 100644 index 0000000000..8e468045b1 --- /dev/null +++ b/src/components/ActionTooltip/__tests__/cases.tsx @@ -0,0 +1,20 @@ +import type {Cases} from '../../../stories/tests-factory/models'; +import type {ActionTooltipProps} from '../ActionTooltip'; + +export const placementCases: Cases = [ + 'auto', + 'auto-start', + 'auto-end', + 'top', + 'bottom', + 'right', + 'left', + 'top-start', + 'top-end', + 'bottom-start', + 'bottom-end', + 'right-start', + 'right-end', + 'left-start', + 'left-end', +];