-
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.
- Loading branch information
Showing
33 changed files
with
126 additions
and
16 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
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
+35.7 KB
...tsx-snapshots/Toast-render-story-ToastPlayground-danger-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
+27.6 KB
...t.tsx-snapshots/Toast-render-story-ToastPlayground-danger-dark-webkit-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
+36.2 KB
...sx-snapshots/Toast-render-story-ToastPlayground-danger-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
+27.3 KB
....tsx-snapshots/Toast-render-story-ToastPlayground-danger-light-webkit-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
+36 KB
...t.tsx-snapshots/Toast-render-story-ToastPlayground-info-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
+27.7 KB
...est.tsx-snapshots/Toast-render-story-ToastPlayground-info-dark-webkit-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
+36.3 KB
....tsx-snapshots/Toast-render-story-ToastPlayground-info-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
+27.5 KB
...st.tsx-snapshots/Toast-render-story-ToastPlayground-info-light-webkit-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
+33.3 KB
...tsx-snapshots/Toast-render-story-ToastPlayground-normal-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
+25 KB
...t.tsx-snapshots/Toast-render-story-ToastPlayground-normal-dark-webkit-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
+32.6 KB
...sx-snapshots/Toast-render-story-ToastPlayground-normal-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.1 KB
....tsx-snapshots/Toast-render-story-ToastPlayground-normal-light-webkit-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
+35.2 KB
...sx-snapshots/Toast-render-story-ToastPlayground-success-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
+27.5 KB
....tsx-snapshots/Toast-render-story-ToastPlayground-success-dark-webkit-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
+36.2 KB
...x-snapshots/Toast-render-story-ToastPlayground-success-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
+27.7 KB
...tsx-snapshots/Toast-render-story-ToastPlayground-success-light-webkit-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
+35.5 KB
...sx-snapshots/Toast-render-story-ToastPlayground-utility-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
+27.4 KB
....tsx-snapshots/Toast-render-story-ToastPlayground-utility-dark-webkit-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
+36.1 KB
...x-snapshots/Toast-render-story-ToastPlayground-utility-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
+27.3 KB
...tsx-snapshots/Toast-render-story-ToastPlayground-utility-light-webkit-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
+35.8 KB
...sx-snapshots/Toast-render-story-ToastPlayground-warning-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
+27.6 KB
....tsx-snapshots/Toast-render-story-ToastPlayground-warning-dark-webkit-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
+36.1 KB
...x-snapshots/Toast-render-story-ToastPlayground-warning-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
+27.4 KB
...tsx-snapshots/Toast-render-story-ToastPlayground-warning-light-webkit-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,87 @@ | ||
import React from 'react'; | ||
|
||
import {test} from '~playwright/core'; | ||
|
||
import type {Toast} from '../Toast/Toast'; | ||
|
||
import {ToastStories} from './helpersPlaywright'; | ||
|
||
const wrapperOptions = { | ||
width: 312, | ||
}; | ||
|
||
function getToastActions(contrastButton = true): React.ComponentProps<typeof Toast>['actions'] { | ||
return [ | ||
{onClick() {}, label: 'Action', view: contrastButton ? 'normal-contrast' : 'normal'}, | ||
{onClick() {}, label: 'Something More', view: 'outlined'}, | ||
]; | ||
} | ||
|
||
const simpleToastProps: React.ComponentProps<typeof Toast> = { | ||
actions: getToastActions(), | ||
removeCallback: () => {}, | ||
name: 'simple-toast', | ||
isClosable: true, | ||
title: 'Do some actions', | ||
content: 'We address you some concerns regarding your last actions in UI', | ||
}; | ||
|
||
test.describe('Toast', {tag: '@Toaster'}, () => { | ||
test('render story: <ToastPlayground> (normal)', async ({mount, expectScreenshot}) => { | ||
await mount( | ||
<ToastStories.ToastPlayground | ||
{...simpleToastProps} | ||
actions={getToastActions(false)} | ||
theme="normal" | ||
/>, | ||
wrapperOptions, | ||
); | ||
|
||
await expectScreenshot(); | ||
}); | ||
|
||
test('render story: <ToastPlayground> (info)', async ({mount, expectScreenshot}) => { | ||
await mount( | ||
<ToastStories.ToastPlayground {...simpleToastProps} theme="info" />, | ||
wrapperOptions, | ||
); | ||
|
||
await expectScreenshot(); | ||
}); | ||
|
||
test('render story: <ToastPlayground> (success)', async ({mount, expectScreenshot}) => { | ||
await mount( | ||
<ToastStories.ToastPlayground {...simpleToastProps} theme="success" />, | ||
wrapperOptions, | ||
); | ||
|
||
await expectScreenshot(); | ||
}); | ||
|
||
test('render story: <ToastPlayground> (warning)', async ({mount, expectScreenshot}) => { | ||
await mount( | ||
<ToastStories.ToastPlayground {...simpleToastProps} theme="warning" />, | ||
wrapperOptions, | ||
); | ||
|
||
await expectScreenshot(); | ||
}); | ||
|
||
test('render story: <ToastPlayground> (danger)', async ({mount, expectScreenshot}) => { | ||
await mount( | ||
<ToastStories.ToastPlayground {...simpleToastProps} theme="danger" />, | ||
wrapperOptions, | ||
); | ||
|
||
await expectScreenshot(); | ||
}); | ||
|
||
test('render story: <ToastPlayground> (utility)', async ({mount, expectScreenshot}) => { | ||
await mount( | ||
<ToastStories.ToastPlayground {...simpleToastProps} theme="utility" />, | ||
wrapperOptions, | ||
); | ||
|
||
await expectScreenshot(); | ||
}); | ||
}); |
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 {composeStories} from '@storybook/react'; | ||
|
||
import * as ToastStoriesImport from '../__stories__/Toaster.stories'; | ||
|
||
export const ToastStories = composeStories(ToastStoriesImport, { | ||
globals: { | ||
screenshotTests: true, | ||
}, | ||
}); |
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