Repository navigation
test(mosaic): add screenshot testing POC - #10451
Conversation
🦋 Changeset detectedLatest commit: df33288 The changes in this PR will be included in the next version bump. This PR includes changesets to release 0 packagesWhen changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important Review skippedReview was skipped as selected files did not have any reviewable changes.
|
@clerk/astro
@clerk/backend
@clerk/chrome-extension
@clerk/clerk-js
@clerk/electron
@clerk/electron-passkeys
@clerk/eslint-plugin
@clerk/expo
@clerk/expo-biometrics
@clerk/expo-google-signin
@clerk/expo-native-components
@clerk/expo-passkeys
@clerk/express
@clerk/fastify
@clerk/hono
@clerk/localizations
@clerk/mosaic
@clerk/nextjs
@clerk/nuxt
@clerk/react
@clerk/react-router
@clerk/shared
@clerk/tanstack-react-start
@clerk/testing
@clerk/ui
@clerk/upgrade
@clerk/vue
commit: |
|
This is awesome, always found visual tests to be a bit flaky, mostly comes from the rendering environment, so maybe we:
I haven't run the suite; these come from reading the code. |
e181368 to
126db7e
Compare
126db7e to
ac036f8
Compare
4099952 to
752d3bf
Compare
752d3bf to
df33288
Compare
Description
Token changes can alter text, borders, and layout without failing behavior tests. This adds six Mosaic screenshot tests. They cover both open switchers, the user profile Account page in light, dark, and narrow layouts, and an edit-name form showing a banner and a field error. The profile tests render the real
<UserProfile />against the fake FAPI, so a change to the profile's sections or pages shows up in the screenshots.Screenshots are generated and compared only inside the digest-pinned Playwright 1.62.1 image, locally and in CI.
pnpm --filter @clerk/mosaic test:visualcompares, andtest:visual:updateregenerates every Linux baseline with Vitest's update mode, so new screenshots are created and unused ones removed. Locally, both mount the checkout into the image and install Linux dependencies into Docker volumes, leaving the hostnode_modulesuntouched. In CI, theMosaic Visual Testsjob builds on the runner with the turbo remote cache and only runs Vitest in the image. The suite bundles Inter, disables CSS motion, hides carets, checks the narrow profile for horizontal overflow, and compares with zero color tolerance and zero mismatched pixels.The comparison is advisory and not a required check. Screenshot differences warn and upload actual, expected, and diff images for seven days. A failed build, or a comparison that crashes before writing images, fails the job.
A token change the suite catches
Dimming dark-mode secondary text from
neutralMix(50, 64.25)toneutralMix(50, 40)fails only the dark profile screenshot. The comparison also catches the change to62, which is too small to see.Checklist
pnpm testruns as expected for Mosaic.pnpm buildruns as expected for Mosaic and its dependencies.Type of change
🤖 Generated with Claude Code