brackt/app/models/__tests__
Chris Parsons 5268e07365
Migrate auth from Clerk to BetterAuth (#354)
* Fix BetterAuth field mapping and add owner-prefixed team names

- Fix auth.server.ts: use camelCase Drizzle field names for BetterAuth
  adapter (was snake_case, causing user inserts to fail); add
  generateId: "uuid" so PostgreSQL UUID columns accept generated IDs
- Add prependOwnerToTeamName / stripOwnerFromTeamName utilities
- Invite join, league creation, and settings assign/remove all now
  manage the owner-prefix on team names atomically

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* Complete BetterAuth migration: auth flows, rename, and cleanup

- Add /forgot-password and /reset-password pages (full password reset flow)
- Add 'Forgot password?' link on login page
- Fix register.tsx: add explicit window.location fallback after signUp
- Rename commissionerAuditLog.actorClerkId → actorUserId (migration 0084)
  and update all references in model, routes, components, and tests
- Rewrite docs/agents/auth.md to document BetterAuth (removes all Clerk refs)
- Update test fixtures and schema comments to remove Clerk ID references;
  use UUID-format IDs throughout test data
- Update docs/agents/domain-models.md ownerId description

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* Fix BetterAuth ID generation, clean up review issues

- Set generateId: false so BetterAuth omits id from inserts; add
  $defaultFn(crypto.randomUUID) to accounts/sessions/verifications
  so Drizzle fills it in (fixes null id constraint violation on signup)
- Move renameTeam to static import; rename before removeTeamOwner so
  a failed rename leaves owner intact rather than leaving a stale prefix
- Clarify stripOwnerFromTeamName toTitleCase assumption in comment
- Annotate reset-password token fallback to explain loader guarantee

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-29 10:03:50 -07:00
..
afl-finals.test.ts Add oxlint linting setup with zero errors (#194) 2026-03-21 09:44:05 -07:00
audit-log.test.ts Migrate auth from Clerk to BetterAuth (#354) 2026-04-29 10:03:50 -07:00
auto-pick.test.ts Fix oxlint warnings: no-shadow, consistent-function-scoping, no-non-null-assertion, and others (#196) 2026-03-21 10:59:51 -07:00
bracket-integration.test.ts Add oxlint linting setup with zero errors (#194) 2026-03-21 09:44:05 -07:00
bracket-seeding.test.ts Add oxlint linting setup with zero errors (#194) 2026-03-21 09:44:05 -07:00
bracket-templates.test.ts Add oxlint linting setup with zero errors (#194) 2026-03-21 09:44:05 -07:00
cfp-12-bracket.test.ts Add NCAA Football CFP simulator (12-team bracket) (#278) 2026-04-08 09:48:32 -04:00
commissioner.test.ts Migrate auth from Clerk to BetterAuth (#354) 2026-04-29 10:03:50 -07:00
draft-pick.test.ts Add Storybook stories for new components from staged changes (#321) 2026-04-23 22:09:25 -07:00
executeAutoPick.timer.test.ts Fix while_on autodraft stalling between chain bursts, fixes #190 (#222) 2026-03-24 19:09:38 -07:00
group-stage-match.test.ts Add FIFA World Cup 2026 support with group stage display and Monte Carlo simulator (#242) 2026-03-29 10:27:47 -07:00
ncaa-68-bracket.test.ts Fix oxlint warnings: no-shadow, consistent-function-scoping, no-non-null-assertion, and others (#196) 2026-03-21 10:59:51 -07:00
nfl-bracket.test.ts Fix oxlint warnings: no-shadow, consistent-function-scoping, no-non-null-assertion, and others (#196) 2026-03-21 10:59:51 -07:00
participant-expected-value.test.ts fix: address VORP code review issues (#283) 2026-04-08 23:20:02 -04:00
playoff-match-game.test.ts Add playoff match game scheduling and odds management (#135) 2026-03-11 14:17:43 -07:00
playoff-match-odds.test.ts Add playoff match game scheduling and odds management (#135) 2026-03-11 14:17:43 -07:00
point-progression.test.ts feat: add recharts library and implement PointProgressionChart component for historical views 2025-11-14 21:18:34 -08:00
process-match-result.test.ts Fix NBA Play-In Round 1 loser advancement logic (#296) 2026-04-15 09:40:53 -07:00
progressive-floor-scoring.test.ts Fix partial bracket scoring, rank labels, and Discord notification bugs (#158) 2026-03-17 12:34:10 -07:00
qualifying-points.test.ts Add oxlint linting setup with zero errors (#194) 2026-03-21 09:44:05 -07:00
regular-season-standings.test.ts Fix standings upsert no-op: use EXCLUDED pseudo-table (#215) 2026-03-23 21:22:53 -07:00
scoring-calculator-qualifying.test.ts feat: Implement Qualifying Points Standings component and related logic 2025-11-11 10:08:25 -08:00
scoring-calculator.test.ts feat: Implement bracket expansion plan to support various tournament structures 2025-11-03 09:36:16 -08:00
scoring-event-dashboard.test.ts Show events on multiple dates when games span requested date range (#254) 2026-04-01 13:39:03 -07:00
season-standings.test.ts Add oxlint linting setup with zero errors (#194) 2026-03-21 09:44:05 -07:00
sports-season.clone.test.ts feat: clone sports season (#282) (#288) 2026-04-11 22:03:37 -07:00
sports-season.test.ts Extract reusable league wizard components; wire settings page (#350) 2026-04-28 22:24:13 -07:00
standings-snapshots.test.ts Add oxlint linting setup with zero errors (#194) 2026-03-21 09:44:05 -07:00
surface-elo.test.ts Add tennis Grand Slam simulator with surface Elo ratings, fixes #116 (#216) 2026-03-23 23:59:35 -07:00
team-projected-score.test.ts Fix tiebreaker incorrectly separating tied teams with pending participants, fixes #244 (#245) 2026-03-29 16:59:13 -07:00
team-score-events.test.ts Add Storybook stories for new components from staged changes (#321) 2026-04-23 22:09:25 -07:00
tiebreaker-logic.test.ts Fix tiebreaker incorrectly separating tied teams with pending participants, fixes #244 (#245) 2026-03-29 16:59:13 -07:00
upcoming-calendar.test.ts Fix upcoming events grouping to separate individual bracket matches (#302) 2026-04-16 14:19:59 -07:00