-
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(Truncate): replace chromatic visual test with playwright
- Loading branch information
1 parent
f85c91e
commit a259d9b
Showing
8 changed files
with
46 additions
and
0 deletions.
There are no files selected for viewing
34 changes: 34 additions & 0 deletions
34
packages/orbit-components/src/Truncate/Truncate.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,34 @@ | ||
import React from "react"; | ||
|
||
import Text from "../Text"; | ||
import Stack from "../Stack"; | ||
import Heading from "../Heading"; | ||
|
||
import Truncate from "."; | ||
|
||
export default function TileStory() { | ||
const content = | ||
"Duis ante orci, molestie vitae vehicula venenatis, tincidunt ac pede. Duis bibendum, lectus ut viverra rhoncus, dolor nunc faucibus libero, eget facilisis enim ipsum id lacus. Nulla pulvinar eleifend sem. Sed ac dolor sit amet purus malesuada congue. Temporibus autem quibusdam et aut officiis debitis aut rerum necessitatibus saepe eveniet ut et voluptates repudiandae sint et molestiae non recusandae. Pellentesque pretium lectus id turpis. Etiam dictum tincidunt diam."; | ||
|
||
return ( | ||
<div className="space-y-sm"> | ||
<Truncate maxWidth="20%"> | ||
<Text>{content}</Text> | ||
</Truncate> | ||
<Stack direction="row"> | ||
<Truncate maxWidth="20%"> | ||
<Text>{content}</Text> | ||
</Truncate> | ||
<Truncate maxWidth="50%"> | ||
<Text>{content}</Text> | ||
</Truncate> | ||
<Truncate> | ||
<Text>{content}</Text> | ||
</Truncate> | ||
</Stack> | ||
<Truncate maxWidth="60%"> | ||
<Heading>This is a Heading component inside a Truncate</Heading> | ||
</Truncate> | ||
</div> | ||
); | ||
} |
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 TruncateStory from "./Truncate.ct-story"; | ||
|
||
test.describe("visual Truncate", () => { | ||
test("Truncate", async ({ mount }) => { | ||
const component = await mount(<TruncateStory />); | ||
|
||
await expect(component).toHaveScreenshot(); | ||
}); | ||
}); |
Binary file added
BIN
+21.6 KB
...runcate/Truncate.ct.tsx-snapshots/visual-Truncate-Truncate-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
+24.2 KB
...e/Truncate.ct.tsx-snapshots/visual-Truncate-Truncate-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
+13.7 KB
...te/Truncate.ct.tsx-snapshots/visual-Truncate-Truncate-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
+11.2 KB
...e/Truncate.ct.tsx-snapshots/visual-Truncate-Truncate-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
+8.97 KB
...te/Truncate.ct.tsx-snapshots/visual-Truncate-Truncate-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
+18.1 KB
...Truncate/Truncate.ct.tsx-snapshots/visual-Truncate-Truncate-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.