stack/apps/e2e/tests/backend/endpoints/api/v1/auth
Mantra e50358710a
fix(tests): use sql.json in onboarding migration test and refresh metrics snapshot (#1420)
## Summary

Two small test-maintenance fixes that came up while running the suite:

- **Onboarding migration test**
(`apps/backend/prisma/migrations/20260420000000_add_project_onboarding_state/tests/default-and-updates.ts`):
switch the JSON insert from `\${JSON.stringify(onboardingState)}::jsonb`
to `\${sql.json(onboardingState)}`. This matches the pattern used by
every other migration test in the repo (see
`20260214000000_fix_trusted_domains_config/tests/*`) and lets the
`postgres` driver handle serialization and parameter binding
consistently rather than relying on a manual `::jsonb` cast.
- **Internal metrics snapshot**
(`apps/e2e/tests/backend/endpoints/api/v1/__snapshots__/internal-metrics.test.ts.snap`):
update `active_users_by_country.AQ` to list `mailbox-2` before
`mailbox-1`. The `should return metrics data with users` test signs in
`mailbox-1` (mailboxes[0]) into AQ first, then later signs `mailbox-2`
(mailboxes[1]) into AQ, so sorted by `last_active_at_millis desc`
`mailbox-2` should come first. The snapshot now matches that ordering.

No production code is touched — both changes are limited to test
fixtures.

## Test plan

- [ ] `pnpm -C apps/backend test run` (migration tests)
- [ ] `pnpm -C apps/e2e test run internal-metrics` (snapshot test)
- [ ] `pnpm lint`
- [ ] `pnpm typecheck`


Made with [Cursor](https://cursor.com)

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Tests**
* No user-facing behavior changed; test flows made more robust and less
flaky (migration validation, metrics ingestion polling, CLI expiry
checks, failed-emails digest expectations).
* **API / Documentation**
* CLI auth default expiration reduced from 2 hours to 2 minutes (updated
OpenAPI defaults and related test expectations).
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-12 10:06:29 -07:00
..
anonymous Turnstile integration for fraud protection (#1239) 2026-03-20 21:26:45 +00:00
cli fix(tests): use sql.json in onboarding migration test and refresh metrics snapshot (#1420) 2026-05-12 10:06:29 -07:00
mfa Upgrade oslo to oslojs (#564) 2025-03-26 02:02:03 +01:00
oauth fix connected accounts tokens (#1358) 2026-04-20 19:33:47 -07:00
otp fix team invitation email check + verification code TOCTOU (#1365) 2026-05-04 17:13:03 -07:00
passkey [Fix] Flaky Neon, Email Delivery, and Other Tests (#1235) 2026-03-10 14:02:41 -07:00
password Sign up rules (#1138) 2026-02-03 11:08:24 -08:00
sessions [Refactor][Feat] Implement Plan Limits for Hard-and-Soft Item Caps (#1215) 2026-05-04 18:25:13 -07:00
email-normalization.test.ts Email outbox backend (#1030) 2025-12-12 10:26:38 -08:00
sign-up-rules.test.ts Fix sign-up rule tests 2026-04-13 14:31:54 -07:00