-
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.
test(Sheet): add smoke visual tests (#1802)
- Loading branch information
1 parent
a29b695
commit 8df5a5c
Showing
13 changed files
with
81 additions
and
5 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
Binary file modified
BIN
-6.25 KB
(87%)
...et.visual.test.tsx-snapshots/Sheet-render-story-Default-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 removed
BIN
-37.5 KB
...heet.visual.test.tsx-snapshots/Sheet-render-story-Default-dark-webkit-linux.png
Binary file not shown.
Binary file modified
BIN
-6.85 KB
(86%)
...t.visual.test.tsx-snapshots/Sheet-render-story-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 removed
BIN
-37.9 KB
...eet.visual.test.tsx-snapshots/Sheet-render-story-Default-light-webkit-linux.png
Binary file not shown.
Binary file added
BIN
+12.7 KB
...__/Sheet.visual.test.tsx-snapshots/Sheet-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
+12.3 KB
....visual.test.tsx-snapshots/Sheet-smoke-hideTopBar-true-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
+13.8 KB
...heet.visual.test.tsx-snapshots/Sheet-smoke-title-Title-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,5 @@ | ||
import type {Cases} from '../../../stories/tests-factory/models'; | ||
import type {SheetProps} from '../Sheet'; | ||
|
||
export const hideTopBarCases: Cases<SheetProps['hideTopBar']> = [true]; | ||
export const titleCases: Cases<SheetProps['title']> = ['Title']; |
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,3 @@ | ||
export const QASheet = { | ||
content: 'content', | ||
}; |
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,34 @@ | ||
import * as React from 'react'; | ||
|
||
import type {SheetProps} from '../Sheet'; | ||
import {Sheet} from '../Sheet'; | ||
|
||
import {QASheet} from './constants'; | ||
|
||
export const TestSheet = (props: Partial<Omit<SheetProps, 'visible' | 'onClose'>>) => { | ||
const [visible, setVisible] = React.useState(false); | ||
|
||
return ( | ||
<div> | ||
<button onClick={() => setVisible(true)}>Show modal</button> | ||
<Sheet | ||
{...props} | ||
visible={visible} | ||
onClose={() => setVisible(false)} | ||
qa={QASheet.content} | ||
> | ||
<div | ||
style={{ | ||
minHeight: 100, | ||
border: '1px solid tomato', | ||
display: 'flex', | ||
justifyContent: 'center', | ||
alignItems: 'center', | ||
}} | ||
> | ||
Sheet content | ||
</div> | ||
</Sheet> | ||
</div> | ||
); | ||
}; |