Skip to content
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 9 commits into from
Nov 21, 2024
Merged

test: stories for dialogs #372

merged 9 commits into from
Nov 21, 2024

Conversation

codeincontext
Copy link
Collaborator

@codeincontext codeincontext commented Nov 19, 2024

Adds stories for each of our dialogs. Each dialog has a component, but we interact with them through the DialogContents component. I figured it made sense to test through that interface

Mocking providers

Some of the dialogs need some mocked data from posthog, the demo status, or the demo API call. For the time being I've mocked each of these at the highest point possible, to help with coverage. eg: Mock the tRPC call from the DemoProvider, rather than mocking the DemoProvider itself. These patterns might change in the future as we learn more about storybook and have more tests in place

MSW (Mock Service Worker)

This is the recommended way to mock network requests in storybook. It seems to work really nicely out of the box

Snapshots

You can see the story changes in chromatic

Copy link

vercel bot commented Nov 19, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
oak-ai-lesson-assistant ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 20, 2024 3:12pm

Copy link

github-actions bot commented Nov 19, 2024

Playwright test results

passed  15 passed
skipped  1 skipped

Details

report  Open report ↗︎
stats  16 tests across 15 suites
duration  2 minutes, 15 seconds
commit  2f9bf4f

Skipped tests

No persona › tests/auth.test.ts › authenticate through Clerk UI

@@ -35,7 +35,7 @@ const dialogTitlesAndIcons: Record<
iconName: "warning",
},
"demo-interstitial": {
title: "Lesson limit reached",
title: "Demo lesson limits",
Copy link
Collaborator Author

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

Copy link
Collaborator Author

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

@@ -0,0 +1,295 @@
/* eslint-disable */
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is autogenerated

Copy link
Contributor

@JBR90 JBR90 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@codeincontext codeincontext merged commit 03df2c3 into main Nov 21, 2024
17 of 18 checks passed
@codeincontext codeincontext deleted the test/dialogs branch November 21, 2024 09:30
@oak-machine-user
Copy link
Collaborator

🎉 This PR is included in version 1.16.2 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants