-
Notifications
You must be signed in to change notification settings - Fork 152
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(ListChoice): replace chromatic visual test with playwright
- Loading branch information
1 parent
c2f1e09
commit 4624b5a
Showing
8 changed files
with
60 additions
and
0 deletions.
There are no files selected for viewing
48 changes: 48 additions & 0 deletions
48
packages/orbit-components/src/ListChoice/ListChoice.ct-story.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,48 @@ | ||
import React from "react"; | ||
|
||
import Button from "../Button"; | ||
import Airplane from "../icons/Airplane"; | ||
import Boat from "../icons/Boat"; | ||
import Bus from "../icons/Bus"; | ||
import Train from "../icons/Train"; | ||
import Plus from "../icons/Plus"; | ||
|
||
import ListChoice from "."; | ||
|
||
export default function ListChoiceVisualStory() { | ||
return ( | ||
<> | ||
<ListChoice title="Selectable no icon" description="Further description" selectable /> | ||
<ListChoice title="Title only and disabled, no icon" disabled /> | ||
<ListChoice title="Selectable" description="Further description" selectable icon={<Bus />} /> | ||
<ListChoice | ||
title="Selected" | ||
description="Further description" | ||
selectable | ||
selected | ||
icon={<Airplane />} | ||
/> | ||
<ListChoice | ||
title="Selected and disabled" | ||
description="Further description" | ||
selectable | ||
selected | ||
disabled | ||
icon={<Train />} | ||
/> | ||
<ListChoice | ||
title="Non-selected and disabled" | ||
description="Further description" | ||
selectable | ||
disabled | ||
icon={<Train />} | ||
/> | ||
<ListChoice | ||
title="Action" | ||
description="Further description" | ||
icon={<Boat />} | ||
action={<Button iconLeft={<Plus />} size="small" type="primarySubtle" />} | ||
/> | ||
</> | ||
); | ||
} |
12 changes: 12 additions & 0 deletions
12
packages/orbit-components/src/ListChoice/ListChoice.ct.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,12 @@ | ||
import * as React from "react"; | ||
import { test, expect } from "@playwright/experimental-ct-react"; | ||
|
||
import ListChoiceStory from "./ListChoice.ct-story"; | ||
|
||
test.describe("visual ListChoice", () => { | ||
test("ListChoice", async ({ mount }) => { | ||
const component = await mount(<ListChoiceStory />); | ||
|
||
await expect(component).toHaveScreenshot(); | ||
}); | ||
}); |
Binary file added
BIN
+36.8 KB
...e/ListChoice.ct.tsx-snapshots/visual-ListChoice-ListChoice-1-Desktop-darwin.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
+37.5 KB
...Choice.ct.tsx-snapshots/visual-ListChoice-ListChoice-1-Large-Desktop-darwin.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
+41.1 KB
...tChoice.ct.tsx-snapshots/visual-ListChoice-ListChoice-1-Large-Mobile-darwin.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
+39.4 KB
...Choice.ct.tsx-snapshots/visual-ListChoice-ListChoice-1-Medium-Mobile-darwin.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
+38 KB
...tChoice.ct.tsx-snapshots/visual-ListChoice-ListChoice-1-Small-Mobile-darwin.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
+43 KB
...ce/ListChoice.ct.tsx-snapshots/visual-ListChoice-ListChoice-1-Tablet-darwin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.