brackt/app/services/simulations/__tests__
Chris Parsons dfbcb7d953
All checks were successful
🚀 Deploy / 🧪 Test (pull_request) Successful in 3m14s
🚀 Deploy / ʦ🔍 Typecheck & Lint (pull_request) Successful in 1m41s
🚀 Deploy / 🐳 Build (pull_request) Has been skipped
🚀 Deploy / 🚀 Deploy (pull_request) Has been skipped
Add complete CS2 event reset to clear orphaned results/QP
The CS2 Major EV simulation silently discarded the Champions Stage
bracket for IEM Cologne 2026: the bracket seeded "Team Spirit" in QF1
while the stage assignments listed the (different) "Spirit Academy", so
the realBracket gate found an out-of-field participant and rejected the
whole bracket. The phantom "Spirit Academy" also left a stray
event_results row (33 rows for 32 teams).

The existing "Reset all" button only cleared cs2_major_stage_results, so
re-entering couldn't remove the phantom result or its cached QP total.

Add resetCs2Event, which also deletes the event's event_results and
recomputes the affected participants' cached QP totals — all inside a
single transaction so a mid-operation failure can't leave the event in a
torn state. It deliberately preserves the Champions Stage bracket so
re-entry realigns the stage data to it. The reset button now confirms
and states that results/QP are cleared too.

Tests: resetCs2Event clear+recompute behavior, and a simulator
regression pinning that one out-of-field QF participant disables the
whole bracket.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-19 22:22:11 -07:00
..
afl-simulator.test.ts Add projected-wins input mode to admin Elo Ratings page (#306) 2026-04-17 12:40:08 -07:00
auto-racing-simulator.test.ts claude/trusting-heisenberg-r6xnfi (#90) 2026-06-15 03:34:44 +00:00
brackt-simulator.test.ts Add Brackt as a league-private meta-sport (#200) (#377) 2026-05-04 20:31:44 -07:00
college-hockey-simulator.test.ts Fix college hockey bracket resolution (#396) 2026-05-08 12:29:39 -07:00
cs-major-simulator.test.ts Add complete CS2 event reset to clear orphaned results/QP 2026-06-19 22:22:11 -07:00
darts-simulator.test.ts Fix simulator correctness bugs and reduce test iteration counts (#61) 2026-05-31 17:39:43 +00:00
epl-simulator.test.ts Fix simulator correctness bugs and reduce test iteration counts (#61) 2026-05-31 17:39:43 +00:00
golf-simulator.test.ts Add not-participating exclusion support for event results (#446) 2026-05-19 11:13:32 -07:00
input-policy.test.ts Fix EPL simulator parity config (#421) 2026-05-13 15:02:23 -07:00
llws-simulator.test.ts Fix MLB standings 406 error and refactor ESPN adapter shared code (#62) 2026-06-01 03:31:18 +00:00
manifest.test.ts Fix EPL simulator parity config (#421) 2026-05-13 15:02:23 -07:00
mlb-simulator.test.ts Fix MLB simulator: projected wins drive seeding, perf fix, + surface simulate errors (#65) 2026-06-01 20:50:03 +00:00
mls-simulator.test.ts Add MLS standings sync and fix simulator conference resolution (#423) 2026-05-14 15:39:40 -07:00
nba-simulator.test.ts fix: NBA play-in bracket advancement bugs (#292) 2026-04-12 22:25:32 -07:00
ncaa-football-simulator.test.ts Add NCAA Football CFP simulator (12-team bracket) (#278) 2026-04-08 09:48:32 -04:00
ncaam-simulator.test.ts Upgrade NCAA preseason simulators (#419) 2026-05-12 22:26:25 -07:00
ncaaw-simulator.test.ts Upgrade NCAA preseason simulators (#419) 2026-05-12 22:26:25 -07:00
nfl-simulator.test.ts Add NFL season + playoffs Monte Carlo simulator (#272) 2026-04-07 09:39:34 -04:00
nhl-simulator.test.ts Fix simulator brackets: NHL bracket-aware mode, MLB/NBA/WNBA sourceElo support (#358) 2026-04-30 08:33:57 -07:00
nll-simulator.test.ts Add NLL box lacrosse simulator implementation plan and preseason-draftability guidance (#417) 2026-05-12 14:22:34 -07:00
runner.test.ts Hide completed seasons in admin tools (#418) 2026-05-12 16:52:26 -07:00
simulator-config.test.ts Fix college hockey bracket resolution (#396) 2026-05-08 12:29:39 -07:00
snooker-simulator.test.ts Add snooker bracket simulator and Elo ratings admin UI, fixes #119 2026-03-23 08:24:28 -07:00
tennis-simulator.test.ts Add not-participating exclusion support for event results (#446) 2026-05-19 11:13:32 -07:00
ucl-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
wnba-simulator.test.ts Fix simulator brackets: NHL bracket-aware mode, MLB/NBA/WNBA sourceElo support (#358) 2026-04-30 08:33:57 -07:00
world-cup-simulator.test.ts Fix remaining world-cup simulator test timeouts (100 → 20 iterations) 2026-06-06 09:47:24 -07:00