fix: show correct "Game X of 7" for future playoff dates
Enrich raw score-endpoint games with gameNumber from the series cache before parsing. The score API omits gameNumber and its seriesStatus reflects current wins, so all future games in a series computed the same number. Now we cross-reference by game id against the cached series-detail endpoint which includes the correct gameNumber per game. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -181,9 +181,15 @@ class TestSeriesSummary:
|
||||
)
|
||||
assert series_summary(game) == "Game 2 of 7"
|
||||
|
||||
def test_fut_game_suppresses_summary(self):
|
||||
def test_fut_game_uses_explicit_game_number(self):
|
||||
game = make_playoff_game(
|
||||
top_wins=1, bottom_wins=1, game_state="FUT", game_number=4
|
||||
)
|
||||
assert series_summary(game) == "Game 4 of 7"
|
||||
|
||||
def test_fut_game_without_game_number_uses_fallback(self):
|
||||
game = make_playoff_game(top_wins=1, bottom_wins=1, game_state="FUT")
|
||||
assert series_summary(game) == ""
|
||||
assert series_summary(game) == "Game 3 of 7"
|
||||
|
||||
|
||||
class TestIsPinned:
|
||||
|
||||
Reference in New Issue
Block a user