-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: add stories for chat header (#437)
- Loading branch information
1 parent
1200b1f
commit 53fc941
Showing
2 changed files
with
72 additions
and
0 deletions.
There are no files selected for viewing
64 changes: 64 additions & 0 deletions
64
apps/nextjs/src/components/AppComponents/Chat/header.stories.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 |
---|---|---|
@@ -0,0 +1,64 @@ | ||
import type { Meta, StoryObj } from "@storybook/react"; | ||
|
||
import { DemoContext } from "@/components/ContextProviders/Demo"; | ||
|
||
import { chromaticParams } from "../../../../.storybook/chromatic"; | ||
import { Header } from "./header"; | ||
|
||
const DemoDecorator: Story["decorators"] = (Story, { parameters }) => ( | ||
<DemoContext.Provider | ||
value={{ | ||
isDemoUser: false, | ||
isSharingEnabled: true, | ||
...parameters.demoContext, | ||
}} | ||
> | ||
<Story /> | ||
</DemoContext.Provider> | ||
); | ||
|
||
const meta: Meta<typeof Header> = { | ||
title: "Components/Layout/ChatHeader", | ||
component: Header, | ||
tags: ["autodocs"], | ||
decorators: [DemoDecorator], | ||
parameters: { | ||
layout: "fullscreen", | ||
...chromaticParams(["legacy"]), | ||
docs: { | ||
story: { | ||
height: "150px", | ||
}, | ||
}, | ||
}, | ||
}; | ||
|
||
export default meta; | ||
type Story = StoryObj<typeof Header>; | ||
|
||
export const Default: Story = { | ||
args: {}, | ||
}; | ||
|
||
export const DemoUser: Story = { | ||
args: {}, | ||
parameters: { | ||
demoContext: { | ||
isDemoUser: true, | ||
appSessionsPerMonth: 3, | ||
appSessionsRemaining: 2, | ||
}, | ||
...chromaticParams(["legacy", "desktop-wide"]), | ||
}, | ||
}; | ||
|
||
export const DemoLoading: Story = { | ||
args: {}, | ||
parameters: { | ||
demoContext: { | ||
isDemoUser: true, | ||
appSessionsPerMonth: 3, | ||
appSessionsRemaining: undefined, | ||
}, | ||
}, | ||
}; |
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