Skip to content

Commit

Permalink
chore: add test stories
Browse files Browse the repository at this point in the history
  • Loading branch information
tomdavies73 committed Nov 12, 2024
1 parent a0db6bc commit f968377
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import Icon from "../icon";
import Textbox from "../textbox";
import Box from "../box";
import { StepFlow } from "../step-flow";
import Typography from "../typography";

export default {
title: "Dialog Full Screen/Test",
Expand Down Expand Up @@ -246,3 +247,17 @@ export const WithWrappedStickyForm: StoryType = {
},
parameters: { chromatic: { disableSnapshot: true } },
};

export const WithOverflowingContent: StoryType = () => (
<DialogFullScreen title="With Overflowing Content" open onCancel={() => {}}>
{Array.from({ length: 30 }, (_, i) => (
<Typography key={i}>This is line {i + 1}</Typography>
))}
</DialogFullScreen>
);

WithOverflowingContent.parameters = {
chromatic: {
disableSnapshot: true,
},
};
14 changes: 14 additions & 0 deletions src/components/dialog/dialog-test.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -494,3 +494,17 @@ export const WithButton = {
);
},
};

export const WithOverflowingContent: StoryType = () => (
<Dialog title="With Overflowing Content" open onCancel={() => {}}>
{Array.from({ length: 30 }, (_, i) => (
<Typography key={i}>This is line {i + 1}</Typography>
))}
</Dialog>
);

WithOverflowingContent.parameters = {
chromatic: {
disableSnapshot: true,
},
};
21 changes: 21 additions & 0 deletions src/components/sidebar/sidebar-test.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -175,3 +175,24 @@ export const WithForm: StoryObj<typeof Sidebar> = {
</Sidebar>
),
};

export const WithOverflowingContent: StoryObj<typeof Sidebar> = {
render: (args) => (
<Sidebar
{...args}
header={<Typography variant="h3">With overflowing content</Typography>}
open
onCancel={() => {}}
>
{Array.from({ length: 30 }, (_, i) => (
<Typography key={i}>This is line {i + 1}</Typography>
))}
</Sidebar>
),
};

WithOverflowingContent.parameters = {
chromatic: {
disableSnapshot: true,
},
};

0 comments on commit f968377

Please sign in to comment.