Skip to content

Commit

Permalink
test(Tag): add RTL and removable with icon snapshots
Browse files Browse the repository at this point in the history
  • Loading branch information
domihustinova authored and mvidalgarcia committed Jul 31, 2024
1 parent ec47a4a commit 92967e9
Show file tree
Hide file tree
Showing 14 changed files with 20 additions and 0 deletions.
9 changes: 9 additions & 0 deletions packages/orbit-components/src/Tag/Tag.ct-story.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ export function DefaultTestStory() {
<Tag selected onRemove={() => {}} onClick={() => {}}>
Selected Removable
</Tag>
<Tag onRemove={() => {}} iconLeft={<Icons.PlusMinus />}>
Removable with icon
</Tag>
</div>
<h2>Colored</h2>
<div className="gap-sm flex flex-wrap">
Expand All @@ -47,6 +50,9 @@ export function DefaultTestStory() {
<Tag type="colored" selected onRemove={() => {}} onClick={() => {}}>
Selected Removable
</Tag>
<Tag type="colored" onRemove={() => {}} iconLeft={<Icons.PlusMinus />}>
Removable with icon
</Tag>
</div>
<h2>dateTag</h2>
<div className="gap-sm flex flex-wrap">
Expand Down Expand Up @@ -76,6 +82,9 @@ export function DefaultTestStory() {
<Tag size="small" onRemove={() => {}}>
Small removable
</Tag>
<Tag size="small" onRemove={() => {}} iconLeft={<Icons.PlusMinus />}>
Small removable with icon
</Tag>
</div>
</div>
);
Expand Down
11 changes: 11 additions & 0 deletions packages/orbit-components/src/Tag/Tag.ct.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import * as React from "react";
import { test, expect } from "@playwright/experimental-ct-react";

import { TestTag, DefaultTestStory } from "./Tag.ct-story";
import RenderInRtl from "../utils/rtl/RenderInRtl";

const NON_INTERACTABLE_TAGS = [
{
Expand Down Expand Up @@ -87,4 +88,14 @@ test.describe("visual Tag", () => {
await expect(component).toHaveScreenshot();
});
});

test("screenshot rtl general", async ({ mount }) => {
const component = await mount(
<RenderInRtl>
<DefaultTestStory />
</RenderInRtl>,
);

await expect(component).toHaveScreenshot();
});
});
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 92967e9

Please sign in to comment.