fix: pin playoff card to its own gameNumber so the header doesn't tick forward after a final
CI / Lint (push) Successful in 10s
CI / Test (push) Successful in 10s
CI / Build & Push (push) Successful in 23s

series_state derives game_number from topSeedWins + bottomSeedWins + 1, which becomes the *next* game's number once the API advances seriesStatus post-final. The card for the just-finished game would then read "Game N+1 of 7". Prefer the raw gameNumber on the game payload, falling back to the derived value when it's missing.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-04-19 18:41:04 -04:00
parent 13bb90b52b
commit e908139323
3 changed files with 22 additions and 3 deletions
+6
View File
@@ -149,6 +149,12 @@ class TestSeriesSummary:
game = make_playoff_game(top_wins=1, bottom_wins=1)
assert series_summary(game) == "Game 3 of 7"
def test_finished_game_keeps_its_own_number(self):
# seriesStatus has advanced to 2-0 after this game finished, but the
# raw gameNumber pins the card to the game it actually represents.
game = make_playoff_game(top_wins=2, bottom_wins=0, game_number=2)
assert series_summary(game) == "Game 2 of 7"
class TestIsPinned:
def test_game7_live_is_pinned(self):