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: set up chromatic config and get storybook building #344

Merged
merged 8 commits into from
Nov 7, 2024

Conversation

codeincontext
Copy link
Collaborator

@codeincontext codeincontext commented Nov 6, 2024

This is the first step of getting visual regression testing going. There will be follow up work to add more test cases and tweak the setup, so the goal of the PR is to find a good starting point

Description

  • Remove unused providers for now
    • This fixes a lookup-on-undefined error related to a "text-primary" key. The error was only present when building storybook rather than opening in dev mode
    • When we add more stories we can evaluate the correct providers to use in the global decorator vs on a per-story basis. For example, we will need to mock some providers with setup state
  • Add chromatic configuration
  • Remove ChatUserAccessCheck. It had a story but we don't actually use it any more
  • Add chromatic github workflow
  • Only run chromatic in CI when files in apps/nextjs have changed

How to test

You'll see some new checks on this PR:

  • Storybook publish: This is the hosted storybook
  • UI tests: These will flag up UI changes so the developer can find bugs
  • UI review: This is for designers, owners, and QAs to quickly review the UI changes in the PR and approve them. It's an optional feature and we can decide whether it works for us

Copy link

vercel bot commented Nov 6, 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 7, 2024 5:31pm

Copy link

github-actions bot commented Nov 6, 2024

Playwright test results

passed  14 passed
skipped  1 skipped

Details

report  Open report ↗︎
stats  15 tests across 14 suites
duration  1 minute, 51 seconds
commit  f355a23

Skipped tests

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

@codeincontext codeincontext marked this pull request as ready for review November 6, 2024 15:51
@codeincontext codeincontext requested a review from a team November 6, 2024 16:34
Comment on lines +30 to +38
// Providers not currently used
// - MockClerkProvider
// - CookieConsentProvider
// - DemoProvider
// - LessonPlanTrackingProvider
// - DialogProvider
// - OakThemeProvider
// - SidebarProvider
// - ChatModerationProvider
Copy link
Collaborator Author

@codeincontext codeincontext Nov 6, 2024

Choose a reason for hiding this comment

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

One of these providers was causing an error looking up text-primary. For the time being, it looks like none of our current stories need them

As we add more stories, we can decide which providers should be global and which should be defined by the story itself. For example, I expect that SidebarProvider is only used for sidebar components. Or DemoProvider might need to be mocked to test components in different states

Copy link
Contributor

@stefl stefl left a comment

Choose a reason for hiding this comment

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

Great stuff! Excited to get this in

apps/nextjs/package.json Outdated Show resolved Hide resolved
Copy link

sonarqubecloud bot commented Nov 7, 2024

@codeincontext codeincontext merged commit 7a34686 into main Nov 7, 2024
18 checks passed
@codeincontext codeincontext deleted the test/chromatic-ci branch November 7, 2024 17:58
@oak-machine-user
Copy link
Collaborator

🎉 This PR is included in version 1.14.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.

3 participants