test(mosaic): cover the user button with feature tests in place of per-layer tests - #9943
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: 83fb51b 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 |
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository YAML (base), Organization UI (inherited) Review profile: ASSERTIVE Plan: Team Run ID: 📒 Files selected for processing (7)
🔗 Linked repositories identifiedCodeRabbit considers these linked repositories for cross-repo context during reviews:
💤 Files with no reviewable changes (2)
Included review availability: This review used your included allowance. 7 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 8 reviews per hour. 📝 WalkthroughWalkthroughThe changes add broad UserButton feature-test coverage for modes, menu content, actions, loading states, accessibility, and URL handoffs. They remove the separate model and view test files. Fake FAPI now adds a membership after invitation acceptance. Integration tests and the example page are updated. Priority: ⬇️ Low Estimated code review effort: 3 (Moderate) | ~25 minutes Suggested reviewers: Merge Risk: ⚪ Minimal · up to The popup-state tests detect the claimed regression. No actionable merge-blocking issue remains after normal checks. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 9 functions across 4 files. (1 skipped: 1 unsupported.)
Comment |
8589444 to
f9a8c57
Compare
18d7d82 to
f531599
Compare
f531599 to
c2c30ca
Compare
c2c30ca to
f1ea25f
Compare
f1ea25f to
25dfd54
Compare
e40a110 to
73ee31d
Compare
25dfd54 to
8c291fe
Compare
73ee31d to
71824eb
Compare
8c291fe to
5a1f42b
Compare
5a1f42b to
27ec7b0
Compare
27ec7b0 to
75bed67
Compare
75bed67 to
be632f9
Compare
be632f9 to
bad6a80
Compare
bad6a80 to
83fb51b
Compare
@clerk/astro
@clerk/backend
@clerk/chrome-extension
@clerk/clerk-js
@clerk/electron
@clerk/electron-passkeys
@clerk/eslint-plugin
@clerk/expo
@clerk/expo-google-signin
@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: |
Description
Follows #9942. Moves UserButton coverage onto the feature tier and deletes the per-layer tests it replaces.
Deleted (1,990 lines):
user-button.model.test.tsxanduser-button.view.test.tsx.user-button.layout.test.tsstays: it is a table over a pure function.user-button.feature.test.tsxnow covers each mode's surface, workspace ordering and offers, the foot andmenuItemOrder, in-flight states, the trigger, account naming fallbacks, routing (userProfileUrl,organizationProfileUrl, add account, pending session tasks) and the portal root. Queries go through roles, names and text, not styling classes.The Mosaic UserButton E2E keeps only what a faked FAPI can't prove: an organization switch that survives a reload, sign-out, add account reaching
/sign-in, a custom link navigating, and a custom page in the realUserProfilemodal. The signed-out render, the custom action, and account switching are left to the feature test.Not carried over, because nothing in the rendered UserButton can reach it:
planLabelis never set by the model)The fake FAPI also changes:
Checklist
pnpm testruns as expected.pnpm buildruns as expected.Type of change