-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test: stories for dialogs #372
Merged
Merged
Changes from 7 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
937b447
UI fixes
codeincontext d137eac
Fix demo user mock
codeincontext ffa4d79
Add dialog stories
codeincontext 9ff93c1
Add debugging
codeincontext fe9c2ac
Fix ts
codeincontext 5141368
Add survey fixture
codeincontext a922693
Add report-content
codeincontext 7150757
Add MSW
codeincontext 2f9bf4f
Revert hideIcon change
codeincontext File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
129 changes: 129 additions & 0 deletions
129
apps/nextjs/src/components/DialogControl/DialogContents.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,129 @@ | ||
import type { Meta, StoryObj } from "@storybook/react"; | ||
|
||
import type { AnalyticsContext } from "@/components/ContextProviders/AnalyticsProvider"; | ||
import { analyticsContext } from "@/components/ContextProviders/AnalyticsProvider"; | ||
|
||
import { DialogContext } from "../AppComponents/DialogContext"; | ||
import { DemoProvider } from "../ContextProviders/Demo"; | ||
import DialogContents from "./DialogContents"; | ||
|
||
const meta: Meta<typeof DialogContents> = { | ||
title: "Components/Dialogs/DialogContents", | ||
component: DialogContents, | ||
decorators: (Story, { parameters }) => { | ||
return ( | ||
<DialogContext.Provider | ||
value={{ | ||
dialogWindow: parameters.dialogWindow, | ||
setDialogWindow: () => {}, | ||
}} | ||
> | ||
<Story /> | ||
</DialogContext.Provider> | ||
); | ||
}, | ||
}; | ||
|
||
export default meta; | ||
type Story = StoryObj<typeof DialogContents>; | ||
|
||
export const ShareChat: Story = { | ||
args: { | ||
lesson: {}, | ||
chatId: "example-chat-id", | ||
isShared: false, | ||
}, | ||
parameters: { | ||
dialogWindow: "share-chat", | ||
}, | ||
}; | ||
|
||
export const ReportContent: Story = { | ||
args: {}, | ||
parameters: { | ||
dialogWindow: "report-content", | ||
}, | ||
}; | ||
|
||
export const DemoShareLocked: Story = { | ||
args: {}, | ||
parameters: { | ||
dialogWindow: "demo-share-locked", | ||
auth: "signedInDemo", | ||
}, | ||
decorators: [ | ||
(Story) => ( | ||
<DemoProvider> | ||
<Story /> | ||
</DemoProvider> | ||
), | ||
], | ||
}; | ||
|
||
export const DemoInterstitial: Story = { | ||
args: {}, | ||
parameters: { | ||
dialogWindow: "demo-interstitial", | ||
auth: "signedInDemo", | ||
}, | ||
decorators: [ | ||
(Story) => ( | ||
<DemoProvider> | ||
<Story /> | ||
</DemoProvider> | ||
), | ||
], | ||
}; | ||
|
||
export const Feedback: Story = { | ||
args: {}, | ||
parameters: { | ||
dialogWindow: "feedback", | ||
}, | ||
decorators: (Story) => { | ||
return ( | ||
<analyticsContext.Provider | ||
value={ | ||
{ | ||
track: () => {}, | ||
trackEvent: () => {}, | ||
identify: () => {}, | ||
reset: () => {}, | ||
page: () => {}, | ||
posthogAiBetaClient: { | ||
capture: () => {}, | ||
getSurveys: (fn) => { | ||
fn([ | ||
{ | ||
id: "01917ac7-e417-0000-0c86-99ef890e6807", | ||
name: "End of Aila generation survey launch aug24", | ||
type: "api", | ||
questions: [ | ||
{ | ||
type: "rating", | ||
question: | ||
"How would you rate the structure and content of this lesson plan?", | ||
}, | ||
{ | ||
type: "rating", | ||
question: | ||
"How would you rate the ease of creating this lesson with Aila?", | ||
}, | ||
{ | ||
type: "open", | ||
question: | ||
"What suggestions do you have to improve the lesson planning experience with Aila?", | ||
}, | ||
], | ||
}, | ||
]); | ||
}, | ||
}, | ||
} as unknown as AnalyticsContext | ||
} | ||
> | ||
<Story /> | ||
</analyticsContext.Provider> | ||
); | ||
}, | ||
}; |
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a copy change, as the previous title was inccorect a lot of the time
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mikeritson-oak it might be worth checking this