test(ui): add AccountButton connected integration test#9191
test(ui): add AccountButton connected integration test#9191alexcarpenter wants to merge 2 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: 088fc5a 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 |
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository YAML (base), Repository UI (inherited) Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
ApprovabilityVerdict: Approved This PR adds integration tests for the AccountButton component with no production code changes. The empty changeset confirms no packages are affected, making this a low-risk test-only addition. You can customize Macroscope's approvability policy. Learn more. |
…n AccountButton integration test
Dismissing prior approval to re-evaluate 088fc5a
What
Adds an end-to-end integration test for the connected
AccountButton— the container from #9185 that wiresAccountButtonViewtouseAccountButtonController. Stacked on top of #9185.Where the existing tests cover each layer in isolation:
account-button.controller.test.tsx— controller → Clerk…this test proves the three layers compose: it renders the real view through the real controller against a mocked
@clerk/shared/react, opens the real headless popover, and clicks the real rows/actions — then asserts both the resulting Clerk calls and the container's close-on-success behavior.Coverage (14 tests)
setActive({ organization, redirectUrl })+ popover closessetActive({ organization: null })+ closessetActive({ session })+ closessignOut({ sessionId })+ closessignOut()+ closesaccept()+revalidate()+ closesaccept()+revalidate()+ closesnavigate('/org-profile')and the popover stays opennavigate('/user-profile')and stays opennavigate('/create-org')and stays openTogether these exercise every callback in the container's
closeOnSuccessset plus every navigation, through the real DOM.Parity with the legacy suites
The legacy
OrganizationSwitcher(30 tests) andUserButton(20 tests) suites are monolithic — all layers in one file. Under the Mosaic split those behaviors route to layers that are already tested, so only the composed-interaction subset belongs here:account-button.controller.test.tsx.getContainer→ N/A; AccountButton navigates viarouter.navigate, notopenXmodals.Feature-parity gaps (not test gaps, tracked separately): AccountButton doesn't yet implement
hidePersonal, force-organization-selection, or the trigger pending-counter badge.Notes
pointer-events: noneuntil row hover), a state jsdom can't apply, so that one interaction usesfireEvent.clickinstead ofuserEvent. Noted inline.turbo/vitest(14/14), type-check, and--quietlint all pass locally.Changeset
Empty — test-only PR, no user-facing change (the feature ships under #9184 / #9185).