-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into add-smoke-tests/Skeleton
- Loading branch information
Showing
312 changed files
with
3,527 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+20.4 KB
....visual.test.tsx-snapshots/ActionTooltip-smoke-default-light-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+23 KB
...t.tsx-snapshots/ActionTooltip-smoke-placement-auto-end-light-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+22.4 KB
....test.tsx-snapshots/ActionTooltip-smoke-placement-auto-light-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+23.4 KB
...tsx-snapshots/ActionTooltip-smoke-placement-auto-start-light-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+23.8 KB
...tsx-snapshots/ActionTooltip-smoke-placement-bottom-end-light-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+22.9 KB
...est.tsx-snapshots/ActionTooltip-smoke-placement-bottom-light-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+24.4 KB
...x-snapshots/ActionTooltip-smoke-placement-bottom-start-light-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+22.5 KB
...t.tsx-snapshots/ActionTooltip-smoke-placement-left-end-light-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+21.6 KB
....test.tsx-snapshots/ActionTooltip-smoke-placement-left-light-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+23.1 KB
...tsx-snapshots/ActionTooltip-smoke-placement-left-start-light-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+23.5 KB
....tsx-snapshots/ActionTooltip-smoke-placement-right-end-light-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+22.4 KB
...test.tsx-snapshots/ActionTooltip-smoke-placement-right-light-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+23.3 KB
...sx-snapshots/ActionTooltip-smoke-placement-right-start-light-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+22.6 KB
...st.tsx-snapshots/ActionTooltip-smoke-placement-top-end-light-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+22.1 KB
...l.test.tsx-snapshots/ActionTooltip-smoke-placement-top-light-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+23.5 KB
....tsx-snapshots/ActionTooltip-smoke-placement-top-start-light-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
66 changes: 66 additions & 0 deletions
66
src/components/ActionTooltip/__tests__/ActionTooltip.visual.test.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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: <div>trigger</div>, | ||
}; | ||
|
||
const smokeScenarios = createSmokeScenarios<ActionTooltipProps>(defaultProps, { | ||
placement: placementCases, | ||
}); | ||
|
||
smokeScenarios.forEach(([title, props]) => { | ||
smokeTest(title, async ({mount, page, expectScreenshot}) => { | ||
const root = await mount( | ||
<div> | ||
<h4>{title}</h4> | ||
<div | ||
style={{ | ||
width: '400px', | ||
height: '400px', | ||
display: 'flex', | ||
justifyContent: 'center', | ||
alignItems: 'center', | ||
}} | ||
> | ||
<div> | ||
<ActionTooltip {...props}> | ||
<div | ||
data-qa="trigger" | ||
style={{ | ||
width: '200px', | ||
height: '200px', | ||
display: 'flex', | ||
justifyContent: 'center', | ||
alignItems: 'center', | ||
border: '1px tomato dotted', | ||
}} | ||
> | ||
trigger block | ||
</div> | ||
</ActionTooltip> | ||
</div> | ||
</div> | ||
</div>, | ||
); | ||
|
||
await root.getByTestId('trigger').hover(); | ||
await expect(page.locator("[role='tooltip']")).toBeVisible({timeout: 1000}); | ||
|
||
await expectScreenshot({ | ||
themes: ['light'], | ||
}); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import type {Cases} from '../../../stories/tests-factory/models'; | ||
import type {ActionTooltipProps} from '../ActionTooltip'; | ||
|
||
export const placementCases: Cases<ActionTooltipProps['placement']> = [ | ||
'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', | ||
]; |
Binary file modified
BIN
-113 Bytes
(92%)
.../Avatar.visual.test.tsx-snapshots/Avatar-render-story-Icon-1-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed
BIN
-1.21 KB
...__/Avatar.visual.test.tsx-snapshots/Avatar-render-story-Icon-1-webkit-linux.png
Binary file not shown.
Binary file modified
BIN
-285 Bytes
(88%)
...Avatar.visual.test.tsx-snapshots/Avatar-render-story-Image-1-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed
BIN
-2 KB
..._/Avatar.visual.test.tsx-snapshots/Avatar-render-story-Image-1-webkit-linux.png
Binary file not shown.
Binary file modified
BIN
-285 Bytes
(88%)
...isual.test.tsx-snapshots/Avatar-render-story-ImageFallback-1-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-9.75 KB
(91%)
...tar.visual.test.tsx-snapshots/Avatar-render-story-Showcase-1-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed
BIN
-82.7 KB
...vatar.visual.test.tsx-snapshots/Avatar-render-story-Showcase-1-webkit-linux.png
Binary file not shown.
Binary file modified
BIN
-24 Bytes
(98%)
.../Avatar.visual.test.tsx-snapshots/Avatar-render-story-Text-1-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed
BIN
-893 Bytes
...__/Avatar.visual.test.tsx-snapshots/Avatar-render-story-Text-1-webkit-linux.png
Binary file not shown.
Binary file modified
BIN
-116 Bytes
(91%)
...visual.test.tsx-snapshots/Avatar-render-story-TextInitials-1-chromium-linux.png
Oops, something went wrong.
Binary file removed
BIN
-1.14 KB
...r.visual.test.tsx-snapshots/Avatar-render-story-TextInitials-1-webkit-linux.png
Diff not rendered.
Binary file modified
BIN
-312 Bytes
(88%)
...r.visual.test.tsx-snapshots/Avatar-render-story-WithBorder-1-chromium-linux.png
Oops, something went wrong.
Binary file removed
BIN
-2.34 KB
...tar.visual.test.tsx-snapshots/Avatar-render-story-WithBorder-1-webkit-linux.png
Diff not rendered.
Binary file added
BIN
+115 KB
...vatar.visual.test.tsx-snapshots/Avatar-smoke-with-icon-light-chromium-linux.png
Oops, something went wrong.
Binary file added
BIN
+177 KB
...atar.visual.test.tsx-snapshots/Avatar-smoke-with-image-light-chromium-linux.png
Oops, something went wrong.
Binary file added
BIN
+104 KB
...vatar.visual.test.tsx-snapshots/Avatar-smoke-with-text-light-chromium-linux.png
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import type {Cases} from '../../../stories/tests-factory/models'; | ||
import type {AvatarProps} from '../types/main'; | ||
|
||
export const sizeCases: Cases<AvatarProps['size']> = ['xs', 's', 'm', 'l', 'xl']; | ||
export const themeCases: Cases<AvatarProps['theme']> = ['normal', 'brand']; | ||
export const viewCases: Cases<AvatarProps['view']> = ['filled', 'outlined']; | ||
export const backgroundColorCases: Cases<AvatarProps['backgroundColor']> = ['darkblue']; | ||
export const borderColorCases: Cases<AvatarProps['borderColor']> = ['tomato']; | ||
export const titleCases: Cases<AvatarProps['title']> = ['Title']; |
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file added
BIN
+8.3 KB
...al.test.tsx-snapshots/ClipboardButton-smoke-after-copy-light-chromium-linux.png
Oops, something went wrong.
Binary file added
BIN
+7.63 KB
...l.test.tsx-snapshots/ClipboardButton-smoke-after-hover-light-chromium-linux.png
Oops, something went wrong.
Binary file added
BIN
+2.53 KB
...Button.visual.test.tsx-snapshots/ClipboardButton-smoke-light-chromium-linux.png
Oops, something went wrong.
40 changes: 40 additions & 0 deletions
40
src/components/ClipboardButton/__tests__/ClipboardButton.visual.test.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import {smokeTest, test} from '~playwright/core'; | ||
|
||
import type {ClipboardButtonProps} from '../ClipboardButton'; | ||
import {ClipboardButton} from '../ClipboardButton'; | ||
|
||
test.describe('ClipboardButton', {tag: '@ClipboardButton'}, () => { | ||
const defaultProps: ClipboardButtonProps = { | ||
text: 'Text', | ||
onCopy: () => {}, | ||
}; | ||
|
||
smokeTest('', async ({mount, page, expectScreenshot}) => { | ||
const root = await mount( | ||
<div style={{padding: '100px'}}> | ||
<ClipboardButton {...defaultProps} hasTooltip /> | ||
</div>, | ||
); | ||
|
||
await expectScreenshot({ | ||
themes: ['light'], | ||
}); | ||
|
||
await root.locator("button[type='button']").hover(); | ||
|
||
// wait for render tooltip | ||
await page.waitForTimeout(1000); | ||
|
||
await expectScreenshot({ | ||
themes: ['light'], | ||
nameSuffix: 'after hover', | ||
}); | ||
|
||
await root.locator("button[type='button']").click(); | ||
|
||
await expectScreenshot({ | ||
themes: ['light'], | ||
nameSuffix: 'after copy', | ||
}); | ||
}); | ||
}); |
Binary file added
BIN
+413 KB
....test.tsx-snapshots/DefinitionList-render-story-Default-dark-chromium-linux.png
Oops, something went wrong.
Binary file added
BIN
+396 KB
...test.tsx-snapshots/DefinitionList-render-story-Default-light-chromium-linux.png
Oops, something went wrong.
Binary file added
BIN
+399 KB
...visual.test.tsx-snapshots/DefinitionList-smoke-default-light-chromium-linux.png
Oops, something went wrong.
Binary file added
BIN
+402 KB
...sx-snapshots/DefinitionList-smoke-direction-horizontal-light-chromium-linux.png
Oops, something went wrong.
Binary file added
BIN
+407 KB
....tsx-snapshots/DefinitionList-smoke-direction-vertical-light-chromium-linux.png
Oops, something went wrong.
Binary file added
BIN
+526 KB
...ts/DefinitionList-smoke-responsive-contentMaxWidth-100-light-chromium-linux.png
Oops, something went wrong.
Binary file added
BIN
+402 KB
....tsx-snapshots/DefinitionList-smoke-responsive-default-light-chromium-linux.png
Oops, something went wrong.
Binary file added
BIN
+427 KB
...shots/DefinitionList-smoke-responsive-nameMaxWidth-100-light-chromium-linux.png
Oops, something went wrong.
69 changes: 69 additions & 0 deletions
69
src/components/DefinitionList/__tests__/DefinitionList.visual.test.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
import {smokeTest, test} from '~playwright/core'; | ||
|
||
import {createSmokeScenarios} from '../../../stories/tests-factory/create-smoke-scenarios'; | ||
import type {DefinitionListProps} from '../types'; | ||
|
||
import {DefinitionListStories} from './stories'; | ||
|
||
test.describe('DefinitionList', {tag: '@DefinitionList'}, () => { | ||
test('render story <Default>', async ({mount, expectScreenshot}) => { | ||
await mount(<DefinitionListStories.Default />); | ||
|
||
await expectScreenshot(); | ||
}); | ||
|
||
createSmokeScenarios<Omit<DefinitionListProps, 'children'>>( | ||
{}, | ||
{ | ||
direction: ['vertical', 'horizontal'], | ||
}, | ||
).forEach(([title, props]) => { | ||
smokeTest(title, async ({mount, expectScreenshot}) => { | ||
await mount( | ||
<div> | ||
<h4>{title}</h4> | ||
<DefinitionListStories.Default {...props} /> | ||
</div>, | ||
); | ||
|
||
await expectScreenshot({ | ||
themes: ['light'], | ||
}); | ||
}); | ||
}); | ||
|
||
createSmokeScenarios<Omit<DefinitionListProps, 'children'>>( | ||
{ | ||
responsive: true, | ||
}, | ||
{ | ||
nameMaxWidth: [100], | ||
contentMaxWidth: [100], | ||
}, | ||
{ | ||
scenarioName: 'responsive', | ||
}, | ||
).forEach(([title, props]) => { | ||
smokeTest(title, async ({mount, page, expectScreenshot}) => { | ||
const size = page.viewportSize(); | ||
if (size) { | ||
await page.setViewportSize({ | ||
width: 1000, | ||
height: size.height, | ||
}); | ||
} | ||
|
||
await mount( | ||
<div> | ||
<h4>{title}</h4> | ||
<DefinitionListStories.Default {...props} /> | ||
</div>, | ||
{width: 'auto'}, | ||
); | ||
|
||
await expectScreenshot({ | ||
themes: ['light'], | ||
}); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import {composeStories} from '@storybook/react'; | ||
|
||
import * as CSFStories from '../__stories__/DefinitionList.stories'; | ||
|
||
export const DefinitionListStories = composeStories(CSFStories); |
Binary file added
BIN
+61.8 KB
...isual.test.tsx-snapshots/Dialog-smoke-bodyContent-long-light-chromium-linux.png
Oops, something went wrong.
Binary file added
BIN
+24.8 KB
...ual.test.tsx-snapshots/Dialog-smoke-bodyHasBorder-true-light-chromium-linux.png
Oops, something went wrong.
Binary file added
BIN
+24.7 KB
.../Dialog.visual.test.tsx-snapshots/Dialog-smoke-default-light-chromium-linux.png
Oops, something went wrong.
Binary file added
BIN
+25.5 KB
...ual.test.tsx-snapshots/Dialog-smoke-footerLoading-true-light-chromium-linux.png
Oops, something went wrong.
Binary file added
BIN
+24.7 KB
...al.test.tsx-snapshots/Dialog-smoke-footerPreset-danger-light-chromium-linux.png
Oops, something went wrong.
Binary file added
BIN
+24.7 KB
...l.test.tsx-snapshots/Dialog-smoke-footerPreset-default-light-chromium-linux.png
Oops, something went wrong.
Binary file added
BIN
+24.7 KB
...l.test.tsx-snapshots/Dialog-smoke-footerPreset-success-light-chromium-linux.png
Oops, something went wrong.
Binary file added
BIN
+31.1 KB
...l.test.tsx-snapshots/Dialog-smoke-footerShowError-true-light-chromium-linux.png
Oops, something went wrong.
Binary file added
BIN
+28.2 KB
...Dialog-smoke-footerTextButtonApply-Custom-button-apply-light-chromium-linux.png
Oops, something went wrong.
Binary file added
BIN
+27.8 KB
...alog-smoke-footerTextButtonCancel-Custom-button-cancel-light-chromium-linux.png
Oops, something went wrong.
Binary file added
BIN
+82.4 KB
...ual.test.tsx-snapshots/Dialog-smoke-headerCaption-long-light-chromium-linux.png
Oops, something went wrong.
Binary file added
BIN
+27.5 KB
...test.tsx-snapshots/Dialog-smoke-headerInsertAfter-true-light-chromium-linux.png
Oops, something went wrong.
Binary file added
BIN
+28 KB
...est.tsx-snapshots/Dialog-smoke-headerInsertBefore-true-light-chromium-linux.png
Oops, something went wrong.
Binary file added
BIN
+24.7 KB
..._/Dialog.visual.test.tsx-snapshots/Dialog-smoke-size-l-light-chromium-linux.png
Oops, something went wrong.
Binary file added
BIN
+24.7 KB
..._/Dialog.visual.test.tsx-snapshots/Dialog-smoke-size-m-light-chromium-linux.png
Oops, something went wrong.
Binary file added
BIN
+24.7 KB
..._/Dialog.visual.test.tsx-snapshots/Dialog-smoke-size-s-light-chromium-linux.png
Oops, something went wrong.
Oops, something went wrong.