поправлен баланс с удалениями у двух команд

This commit is contained in:
2026-08-20 13:56:44 +03:00
parent d90c4500ad
commit 559888cc0c
2 changed files with 37 additions and 1 deletions

View File

@@ -0,0 +1,24 @@
from pathlib import Path
ROOT = Path(__file__).resolve().parents[1]
APP_JS = (ROOT / "ui_builder/static/app.js").read_text(encoding="utf-8")
def test_authoritative_strength_change_rebalances_penalty_targets():
start = APP_JS.index("function hockeyStoreGameControl")
end = APP_JS.index("async function hockeyLoadGameControl", start)
block = APP_JS[start:end]
assert "const strengthChanged" in block
assert "hockeyStrengthMappingSignature(previousControl) !== hockeyStrengthMappingSignature(payload)" in block
assert "rebalanceVmixPenaltyTargets({ force: true, hideUnused: true })" in block
assert "Penalty strength rebalance error" in block
def test_penalty_plan_still_routes_two_vs_one_to_advantage_side():
start = APP_JS.index("function penaltyDisplayEntriesByTargetSide")
end = APP_JS.index("function hockeyPenaltySideMappingDetail", start)
block = APP_JS[start:end]
assert 'if (advantageSide === "home")' in block
assert 'return { home: take(away), away: [], routedToAdvantage: true, advantageSide: "home" };' in block
assert 'if (advantageSide === "away")' in block
assert 'return { home: [], away: take(home), routedToAdvantage: true, advantageSide: "away" };' in block