-
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: make chromatic use named viewports
- Loading branch information
1 parent
895cd8e
commit bc8c4e2
Showing
4 changed files
with
88 additions
and
4 deletions.
There are no files selected for viewing
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
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
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
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, | ||
}, | ||
}, | ||
}; |