Skip to content

Commit

Permalink
QA updates (#4398)
Browse files Browse the repository at this point in the history
  • Loading branch information
Fercas123 authored Nov 13, 2024
1 parent 6a08b82 commit 2301012
Show file tree
Hide file tree
Showing 3 changed files with 176 additions and 6 deletions.
55 changes: 52 additions & 3 deletions packages/core/stories/dialog/dialog.qa.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,12 @@ import {
VALIDATION_NAMED_STATUS,
} from "@salt-ds/core";
import type { Meta, StoryFn } from "@storybook/react";
import { QAContainer, type QAContainerProps } from "docs/components";
import {
QAContainer,
QAContainerNoStyleInjection,
type QAContainerNoStyleInjectionProps,
type QAContainerProps,
} from "docs/components";
import "./dialog.stories.css";
import { Fragment } from "react";

Expand Down Expand Up @@ -64,7 +69,7 @@ const DialogTemplate: StoryFn<
);
};

export const StatusVariants: StoryFn<QAContainerProps> = () => {
export const StatusVariants: StoryFn = () => {
const DensityValues = ["high", "medium", "low", "touch"] as const;
return (
<StackLayout gap={1}>
Expand Down Expand Up @@ -111,7 +116,7 @@ StatusVariants.parameters = {
},
};

export const ContentVariants: StoryFn<QAContainerProps> = () => {
export const ContentVariants: StoryFn = () => {
const DensityValues = ["high", "medium", "low", "touch"] as const;
const longContent = (
<StackLayout style={{ maxHeight: 180 }}>
Expand Down Expand Up @@ -247,3 +252,47 @@ DialogHeaders.parameters = {
},
},
};

export const NoStyleInjectionDialogHeaders: StoryFn<
QAContainerNoStyleInjectionProps
> = (props) => (
<QAContainerNoStyleInjection
height={600}
cols={1}
itemPadding={5}
width={1200}
{...props}
>
<DialogHeader
header="Terms and conditions"
style={{
width: 600,
}}
/>
<DialogHeader
style={{
width: 600,
}}
header="Terms and conditions"
preheader="Ensure you read and agree to these Terms"
/>
<DialogHeader
status="info"
header="Terms and conditions"
style={{
width: 600,
}}
/>
<DialogHeader
status="info"
style={{
width: 600,
}}
header="Terms and conditions"
preheader="Ensure you read and agree to these Terms"
/>
</QAContainerNoStyleInjection>
);
NoStyleInjectionDialogHeaders.parameters = {
chromatic: { disableSnapshot: false },
};
33 changes: 31 additions & 2 deletions packages/core/stories/file-drop-zone/file-drop-zone.qa.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@ import {
FileDropZoneTrigger,
} from "@salt-ds/core";
import type { Meta, StoryFn } from "@storybook/react";
import { QAContainer } from "docs/components";

import {
QAContainer,
QAContainerNoStyleInjection,
type QAContainerNoStyleInjectionProps,
} from "docs/components";
export default {
title: "Core/File Drop Zone/File Drop Zone QA",
component: FileDropZone,
Expand Down Expand Up @@ -47,3 +50,29 @@ AllExamplesGrid.parameters = {
},
},
};

export const NoStyleInjectionGrid: StoryFn<QAContainerNoStyleInjectionProps> = (
props,
) => {
return (
<QAContainerNoStyleInjection cols={2} itemPadding={4} {...props}>
<FileDropZone onDrop={() => console.log("files accepted")}>
<FileDropZoneIcon />
<strong>Drop files here or</strong>
<FileDropZoneTrigger />
</FileDropZone>
<FileDropZone
className="saltFileDropZone-active"
onDrop={() => console.log("files accepted")}
>
<FileDropZoneIcon />
<strong>Drop files here or</strong>
<FileDropZoneTrigger />
</FileDropZone>
</QAContainerNoStyleInjection>
);
};

NoStyleInjectionGrid.parameters = {
chromatic: { disableSnapshot: false },
};
94 changes: 93 additions & 1 deletion packages/core/stories/overlay/overlay.qa.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@ import {
OverlayTrigger,
} from "@salt-ds/core";
import type { Meta, StoryFn } from "@storybook/react";
import { QAContainer, type QAContainerProps } from "docs/components";
import {
QAContainer,
QAContainerNoStyleInjection,
type QAContainerNoStyleInjectionProps,
type QAContainerProps,
} from "docs/components";

import "./overlay.stories.css";

Expand Down Expand Up @@ -42,6 +47,48 @@ export const Default: StoryFn<QAContainerProps> = (props) => {
};

Default.parameters = {
chromatic: {
disableSnapshot: false,
modes: {
theme: {
themeNext: "disable",
},
themeNext: {
themeNext: "enable",
corner: "rounded",
accent: "teal",
// Ignore headingFont given font is not loaded
},
},
},
};

export const NoStyleInjectionGrid: StoryFn<QAContainerNoStyleInjectionProps> = (
props,
) => (
<QAContainerNoStyleInjection
height={800}
cols={5}
itemPadding={50}
itemWidthAuto
width={1200}
{...props}
>
<Overlay open>
<OverlayTrigger>
<Button>Show Overlay</Button>
</OverlayTrigger>
<OverlayPanel>
<OverlayPanelContent>
<h3 className="content-heading">Title</h3>
<div>Content of Overlay</div>
</OverlayPanelContent>
</OverlayPanel>
</Overlay>
</QAContainerNoStyleInjection>
);

NoStyleInjectionGrid.parameters = {
chromatic: { disableSnapshot: false },
};

Expand Down Expand Up @@ -72,5 +119,50 @@ export const CloseButton: StoryFn<QAContainerProps> = (props) => {
};

CloseButton.parameters = {
chromatic: {
disableSnapshot: false,
modes: {
theme: {
themeNext: "disable",
},
themeNext: {
themeNext: "enable",
corner: "rounded",
accent: "teal",
// Ignore headingFont given font is not loaded
},
},
},
};

export const NoStyleInjectionCloseButton: StoryFn<
QAContainerNoStyleInjectionProps
> = (props) => {
return (
<QAContainerNoStyleInjection
height={800}
cols={5}
itemPadding={50}
itemWidthAuto
width={1200}
{...props}
>
<Overlay open>
<OverlayTrigger>
<Button>Show Overlay</Button>
</OverlayTrigger>
<OverlayPanel>
<OverlayPanelCloseButton />
<OverlayPanelContent>
<h3 className="content-heading">Title</h3>
<div>Content of Overlay</div>
</OverlayPanelContent>
</OverlayPanel>
</Overlay>
</QAContainerNoStyleInjection>
);
};

NoStyleInjectionCloseButton.parameters = {
chromatic: { disableSnapshot: false },
};

0 comments on commit 2301012

Please sign in to comment.