Skip to content

Commit

Permalink
chore: address comments - add test story and enable chromatic snapsho…
Browse files Browse the repository at this point in the history
…t to catch visual regressions
  • Loading branch information
tomdavies73 committed Oct 12, 2023
1 parent 4853fc5 commit 3908bcd
Showing 1 changed file with 31 additions and 2 deletions.
33 changes: 31 additions & 2 deletions src/components/link/link-test.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@ import { action } from "@storybook/addon-actions";
import { ICONS } from "../icon/icon-config";
import { LINK_ALIGNMENTS, LINK_POSITIONS, LINK_VARIANTS } from "./link.config";
import Link, { LinkProps } from "./link.component";
import Box from "../box";

export default {
title: "Link/Test",
includeStories: ["DefaultStory"],
includeStories: ["DefaultStory", "FlexContainer"],
parameters: {
info: { disable: true },
chromatic: {
disableSnapshot: true,
disableSnapshot: false,
},
},
argTypes: {
Expand Down Expand Up @@ -94,6 +95,34 @@ DefaultStory.args = {
isDarkBackground: false,
};

export const FlexContainer = () => {
const link = (
<Box
display="flex"
flexDirection="row"
justifyContent="flex-end"
alignItems="center"
width="60px"
height="40px"
bg="red"
mx={5}
>
<Link icon="close" variant="neutral" />
</Box>
);
return (
<div
style={{
margin: "64px",
width: "fit-content",
padding: "8px",
}}
>
{link}
</div>
);
};

export const LinkComponent = (props: LinkProps) => {
return (
<div
Expand Down

0 comments on commit 3908bcd

Please sign in to comment.