-
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(Checkbox): add visual tests for active tooltip
- Loading branch information
Showing
18 changed files
with
31 additions
and
5 deletions.
There are no files selected for viewing
24 changes: 20 additions & 4 deletions
24
packages/orbit-components/src/Checkbox/Checkbox.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 |
---|---|---|
@@ -1,19 +1,35 @@ | ||
import React from "react"; | ||
|
||
import Text from "../Text"; | ||
import Tooltip from "../Tooltip"; | ||
|
||
import Checkbox from "."; | ||
|
||
export default function CheckboxStory() { | ||
export function CheckboxStory() { | ||
return ( | ||
<div className="space-y-200 flex flex-col"> | ||
<div className="space-y-200 lm:pt-1200 lm:h-auto flex h-[700px] flex-col"> | ||
<Checkbox | ||
label="Check this box" | ||
checked | ||
tooltip={<Tooltip content="Tooltip content is visible" placement="top" />} | ||
/> | ||
<Checkbox label="Check this box" /> | ||
<Checkbox label="Check this box" info="I will find you and will tick you" /> | ||
<Checkbox label="Check this box" checked /> | ||
<Checkbox label="Check this box" disabled /> | ||
<Checkbox label="Check this box" disabled checked /> | ||
<Checkbox label="Check this box" disabled tooltip={<Text>Tooltip</Text>} /> | ||
<Checkbox label="Check this box" hasError /> | ||
</div> | ||
); | ||
} | ||
|
||
export function CheckboxWithTooltipStory() { | ||
return ( | ||
<div className="space-y-200 lm:pt-1200 lm:h-auto flex h-[700px] flex-col"> | ||
<Checkbox | ||
label="Check this box" | ||
checked | ||
tooltip={<Tooltip content="Tooltip content is visible" placement="top" />} | ||
/> | ||
</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 |
---|---|---|
@@ -1,12 +1,22 @@ | ||
import * as React from "react"; | ||
import { test, expect } from "@playwright/experimental-ct-react"; | ||
|
||
import CheckboxStory from "./Checkbox.ct-story"; | ||
import { CheckboxStory, CheckboxWithTooltipStory } from "./Checkbox.ct-story"; | ||
|
||
test.describe("visual Checkbox", () => { | ||
test("Checkbox", async ({ mount }) => { | ||
const component = await mount(<CheckboxStory />); | ||
|
||
component.getByRole("button").hover(); | ||
await expect(component).toHaveScreenshot(); | ||
}); | ||
|
||
test("Checkbox - active tooltip on mobile", async ({ mount, browserName }) => { | ||
test.skip(browserName !== "webkit", "This feature is Safari-only"); | ||
|
||
const component = await mount(<CheckboxWithTooltipStory />); | ||
component.getByRole("button").click(); | ||
|
||
await expect(component).toHaveScreenshot(); | ||
}); | ||
}); |
Binary file added
BIN
+9.8 KB
...s/visual-Checkbox-Checkbox---active-tooltip-on-mobile-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
+20.1 KB
.../visual-Checkbox-Checkbox---active-tooltip-on-mobile-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
+18.8 KB
...s/visual-Checkbox-Checkbox---active-tooltip-on-mobile-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
+10.2 KB
...apshots/visual-Checkbox-Checkbox---active-tooltip-on-mobile-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.
Binary file modified
BIN
+5.47 KB
(130%)
...heckbox/Checkbox.ct.tsx-snapshots/visual-Checkbox-Checkbox-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 removed
BIN
-16.4 KB
...Checkbox/Checkbox.ct.tsx-snapshots/visual-Checkbox-Checkbox-1-Desktop-linux.png
Binary file not shown.
Binary file modified
BIN
+5.52 KB
(130%)
...x/Checkbox.ct.tsx-snapshots/visual-Checkbox-Checkbox-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 removed
BIN
-16.7 KB
...ox/Checkbox.ct.tsx-snapshots/visual-Checkbox-Checkbox-1-Large-Desktop-linux.png
Binary file not shown.
Binary file modified
BIN
+7.21 KB
(130%)
...ox/Checkbox.ct.tsx-snapshots/visual-Checkbox-Checkbox-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 removed
BIN
-16.9 KB
...box/Checkbox.ct.tsx-snapshots/visual-Checkbox-Checkbox-1-Large-Mobile-linux.png
Binary file not shown.
Binary file modified
BIN
+5.64 KB
(130%)
...x/Checkbox.ct.tsx-snapshots/visual-Checkbox-Checkbox-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 removed
BIN
-16.7 KB
...ox/Checkbox.ct.tsx-snapshots/visual-Checkbox-Checkbox-1-Medium-Mobile-linux.png
Binary file not shown.
Binary file modified
BIN
+5.71 KB
(130%)
...ox/Checkbox.ct.tsx-snapshots/visual-Checkbox-Checkbox-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 removed
BIN
-11.5 KB
...box/Checkbox.ct.tsx-snapshots/visual-Checkbox-Checkbox-1-Small-Mobile-linux.png
Binary file not shown.
Binary file modified
BIN
+7.37 KB
(130%)
...Checkbox/Checkbox.ct.tsx-snapshots/visual-Checkbox-Checkbox-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.
Binary file removed
BIN
-17.3 KB
.../Checkbox/Checkbox.ct.tsx-snapshots/visual-Checkbox-Checkbox-1-Tablet-linux.png
Binary file not shown.