feat: self-serve tier — PR 12/12 — Tests & Fixtures
loading diff…
Stack order: Merge after PR 11 — Proxy Trial Lock. This is the final PR in the stack.
Adds all tests, fixtures, and test infrastructure for the self-serve tier feature. Also includes final integration touches across implementation files that were needed to make tests pass.
Why 74 files? 28 are new test/fixture files. The remaining 46 are implementation files from earlier PRs that required minor modifications for test compatibility (e.g., making functions testable, adding test hooks, fixing edge cases discovered during test writing).
| Category | Files | Description |
|---|---|---|
| Unit tests | self-serve-auth.test.ts, self-serve-org-derivation.test.ts, self-serve-signup-state.test.ts, self-serve-signup-callback.test.ts, self-serve-idp-hint.test.ts | Core self-serve logic |
| Route tests | callback/route.test.ts, create-org/route.test.ts | API route handlers |
| Integration | self-serve-flows.integration.test.ts, trpc-admin-flows.integration.test.ts, trpc-mutations-real.test.ts | End-to-end signup and tRPC flows |
| tRPC tests | trpc-procedures.onboarding.test.ts, trpc-procedures.orgs-audit.test.ts, trpc-procedures.teams.test.ts, trpc-procedures.test.setup.ts | Updated for tier awareness |
| Lifecycle tests | archive-expired-trials.test.ts, cron-auth.test.ts, trial-lifecycle-emails.test.ts, org-capacity.test.ts, upgrade-to-enterprise.test.ts, set-audit-mode.test.ts | Trial lifecycle and enterprise gates |
| E2E setup | full-auth-proxy-admin.test.setup.ts, member-auth-connection-tests.test.ts, org-admin-member-lifecycle.test.ts | Multi-tenant E2E harness |
| Playwright | self-serve-signup.spec.ts | Browser E2E for signup flow |
| SCIM | project.test.ts, reconcile.batching.test.ts | Updated for tier |
| App tests | apps.test.ts | App router tier awareness |
packages/test-utils/src/test-fixtures.ts: Updated fixtures with tier, trialEndsAt, hardLockAt, archivedAt fieldspackages/test-utils/src/mock-jwks.ts: Mock JWKS helper for self-serve JWT testingpackages/test-utils/src/index.ts: Re-exports for new helpersdocker-compose.test.yml: Updated test DB configurationFiles from earlier PRs that received minor modifications during test development:
| Category | Count | Examples |
|---|---|---|
| Proxy (7) | app.ts, app-types.ts, app-mcp-routes.ts, server-factory-runtime.ts, index.ts, trial-check.ts, real-mcp-fixture.ts | Test hooks, multi-tenant support fixes |
| Dashboard UI (14) | trial-banner.tsx, app-frame.tsx, app-sidebar*.tsx, upgrade-*.tsx, page files | Edge case fixes discovered in testing |
| Enterprise gates (8) | set-enabled-toolkits.ts, create-auth-config.ts, add-member.ts, etc. | Test compatibility adjustments |
| Lifecycle (7) | archive-expired-trials.ts, cron-auth.ts, trial-lifecycle-emails.ts, provisioning scripts | Fixes from test-driven iteration |
| Webhooks (2) | user-deactivated/route.ts, user-reactivated/route.ts | Updated for multi-tenant |
| SCIM (1) | webhook-ingestion.ts | Self-serve tenant handling |
| Cron routes (4) | archive-expired-trials/route.ts, extend-trial/route.ts, scim-projection-queue/route.ts, trial-lifecycle-emails/route.ts | Test-driven fixes |
| # | PR | Link |
|---|---|---|
| 1 | Foundation | #458 |
| 2 | Core orgId Resolution | #459 |
| 3 | Routers: orgs, audit, onboarding | #460 |
| 4 | Routers: teams, connections, me | #461 |
| 5 | Routers: apps, auth-configs, misc | #462 |
| 6 | Self-Serve Signup Flow | #463 |
| 7 | Sign-In & Auth Broker | #464 |
| 8 | Trial UI | #465 |
| 9 | Enterprise Tier Gates | #466 |
| 10 | Trial Lifecycle | #467 |
| 11 | Proxy Trial Lock | #468 |
| 12 | Tests & Fixtures | this PR |