-
Notifications
You must be signed in to change notification settings - Fork 99
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/Table
- Loading branch information
Showing
22 changed files
with
201 additions
and
8 deletions.
There are no files selected for viewing
Binary file added
BIN
+8.3 KB
...al.test.tsx-snapshots/ClipboardButton-smoke-after-copy-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
+7.63 KB
...l.test.tsx-snapshots/ClipboardButton-smoke-after-hover-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
+2.53 KB
...Button.visual.test.tsx-snapshots/ClipboardButton-smoke-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.
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', | ||
}); | ||
}); | ||
}); |
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 removed
BIN
-900 KB
...ual.test.tsx-snapshots/Label-render-story-ShowcaseStory-dark-chromium-linux.png
Binary file not shown.
Binary file removed
BIN
-533 KB
...isual.test.tsx-snapshots/Label-render-story-ShowcaseStory-dark-webkit-linux.png
Binary file not shown.
Binary file removed
BIN
-909 KB
...al.test.tsx-snapshots/Label-render-story-ShowcaseStory-light-chromium-linux.png
Binary file not shown.
Binary file removed
BIN
-534 KB
...sual.test.tsx-snapshots/Label-render-story-ShowcaseStory-light-webkit-linux.png
Binary file not shown.
Binary file added
BIN
+65.7 KB
...snapshots__/Label.visual.test.tsx-snapshots/Label-smoke-dark-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
+63.6 KB
...napshots__/Label.visual.test.tsx-snapshots/Label-smoke-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
+71.1 KB
.../Label.visual.test.tsx-snapshots/Label-smoke-with-close-dark-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
+69.2 KB
...Label.visual.test.tsx-snapshots/Label-smoke-with-close-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
+71.3 KB
..._/Label.visual.test.tsx-snapshots/Label-smoke-with-copy-dark-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
+69.3 KB
.../Label.visual.test.tsx-snapshots/Label-smoke-with-copy-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
+81.7 KB
....visual.test.tsx-snapshots/Label-smoke-with-custom-icon-dark-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
+80 KB
...visual.test.tsx-snapshots/Label-smoke-with-custom-icon-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.
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,15 @@ | ||
import type {Cases} from '../../../stories/tests-factory/models'; | ||
import type {LabelProps} from '../Label'; | ||
|
||
export const disabledCases: Cases<LabelProps['disabled']> = [true]; | ||
export const themeCases: Cases<LabelProps['theme']> = [ | ||
'normal', | ||
'info', | ||
'danger', | ||
'warning', | ||
'success', | ||
'utility', | ||
'unknown', | ||
'clear', | ||
]; | ||
export const sizeCases: Cases<LabelProps['size']> = ['xs', 's', 'm']; |
This file was deleted.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import {Rocket} from '@gravity-ui/icons'; | ||
import {composeStories} from '@storybook/react'; | ||
|
||
import {Icon} from '../../Icon'; | ||
import type {LabelProps} from '../Label'; | ||
import {Label} from '../Label'; | ||
import * as DefaultLabelStories from '../__stories__/Label.stories'; | ||
|
||
export const LabelStories = composeStories(DefaultLabelStories); | ||
|
||
export const TestLabelWithIcon = (props: Partial<LabelProps>) => { | ||
return <Label icon={<Icon data={Rocket} />} {...props} />; | ||
}; |
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 @@ | ||
export const LabelQa = { | ||
copyButton: 'copy-button', | ||
closeButton: 'close-button', | ||
mainButton: 'main-button', | ||
}; |