brackt/app/services/__tests__
Claude ad238e6bfb
Some checks failed
🚀 Deploy / 🧪 Test (pull_request) Successful in 3m3s
🚀 Deploy / ʦ🔍 Typecheck & Lint (pull_request) Failing after 48s
🚀 Deploy / 🐳 Build (pull_request) Has been skipped
🚀 Deploy / 🚀 Deploy (pull_request) Has been skipped
Address code review: route cloned windows correctly, dedupe canonical query
Follow-up to the QP scoring fix, from self-review:

- Cloned qualifying windows carry a bracketTemplateId (copied by
  cloneSportsSeason) but no playoff matches, so they hit the bracket branch,
  where processQualifyingBracketEvent derives zero states and writes no QP —
  the canonical-tie-count fix never ran for them. processQualifyingEvent now
  routes to the bracket writer only when the window actually has playoff
  matches; otherwise it falls through to the placement/canonical path like any
  no-template sibling.

- The canonical tournament_results tie span was queried once per window inside
  the fan-out loop. syncTournamentResults already loads the canonical results,
  so it now builds the tie-count map once (buildTieCountByPlacement) and passes
  it to each processQualifyingEvent call; direct callers still query it lazily.

- syncTournamentResults no longer re-stamps completedAt on windows that are
  already complete, so a backfill re-run doesn't churn timestamps.

Adds regression tests: a cloned window (template id, no matches) scores R16
losers at 1.5 via the canonical path.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017AUcHy9m7aF6axsY6Grpe4
2026-07-03 21:17:18 +00:00
..
bracket-simulator.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
discord.test.ts Fix qualifying points scoring, Discord rounding, and majors count 2026-07-03 20:40:47 +00:00
draft-discord.server.test.ts claude/discord-pick-notification-refactor-FeusJ (#58) 2026-05-29 16:24:22 +00:00
draft-email.server.test.ts Add draft email notifications feature (#459) 2026-05-20 15:35:43 -07:00
ev-calculator.test.ts feat: add calculateReplacementLevel and calculateVORP to ev-calculator 2026-04-09 01:59:46 +00:00
icm-calculator.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
probability-engine.test.ts Add projected-wins input mode to admin Elo Ratings page (#306) 2026-04-17 12:40:08 -07:00
probability-updater.test.ts Add oxlint linting setup with zero errors (#194) 2026-03-21 09:44:05 -07:00
qualifying-points-discord.server.test.ts Short-circuit QP notifier when nothing drafted is involved 2026-07-03 15:10:07 +00:00
sync-tournament-results.test.ts Address code review: route cloned windows correctly, dedupe canonical query 2026-07-03 21:17:18 +00:00