diff --git a/app/services/simulations/__tests__/cs-major-simulator.test.ts b/app/services/simulations/__tests__/cs-major-simulator.test.ts index 78861b6..f57efad 100644 --- a/app/services/simulations/__tests__/cs-major-simulator.test.ts +++ b/app/services/simulations/__tests__/cs-major-simulator.test.ts @@ -217,14 +217,21 @@ describe("simulateChampionsStage", () => { }); it("top Elo team wins more often than last (stochastic)", () => { - const teams = makeTeams(8); - // team-0 has highest Elo, team-7 has lowest + // Use a clear Elo spread so team-0 has a decisive advantage. + // makeTeams(8) only gives a 70-pt gap (1800→1730) which puts the + // true win rate right at the 0.2 threshold — extremely flaky. + // 100-pt steps (1800→1100) give team-0 a ~40% win rate, well clear of 0.25. + const teams = Array.from({ length: 8 }, (_, i) => ({ + id: `team-${i}`, + elo: 1800 - i * 100, + rank: i + 1, + })); let wins = 0; for (let i = 0; i < 1000; i++) { const result = simulateChampionsStage(teams); if (result.placements.get("team-0") === 1) wins++; } - // Should win significantly more than 12.5% of the time (1/8 random) - expect(wins / 1000).toBeGreaterThan(0.2); + // Should win well above 12.5% (1/8 random baseline) + expect(wins / 1000).toBeGreaterThan(0.25); }); });