Files
weirsoe-party-protocol/docs/ISSUE-180-SPA-NEXT-ROUND-FINAL-LEADERBOARD-EVIDENCE.md
Asger Geel Weirsoee 634bd617e7
All checks were successful
CI / test-and-quality (push) Successful in 2m10s
CI / test-and-quality (pull_request) Successful in 2m26s
feat(spa): render final leaderboard summary in host shell
2026-03-01 15:31:23 +00:00

29 lines
1.5 KiB
Markdown

# Issue #180 Evidence — SPA next-round + final leaderboard
## Flow log (Angular SPA)
1. Host reaches `reveal` phase and runs `loadScoreboard()` (`GET /lobby/sessions/:code/scoreboard`).
2. Host can start next round directly in SPA via `startNextRound()` (`POST /lobby/sessions/:code/rounds/next`) and then session hydrate (`GET /lobby/sessions/:code`) without page reload.
3. Host can finish game directly in SPA via `finishGame()` (`POST /lobby/sessions/:code/finish`), rendering winner + sorted final leaderboard (plus raw payload for debug) in the same shell.
4. Player SPA renders final leaderboard from refreshed finished-session payload (sorted by score desc, nickname tiebreak) without leaving SPA route.
5. Error/retry paths are implemented and covered:
- scoreboard failure -> `scoreboardError` + retry button
- next-round failure -> `nextRoundError` + retry button
- finish-game/final-leaderboard failure -> `finishError` + retry button
## Test evidence
### `frontend/angular` (Vitest)
- `src/app/features/host/host-shell.component.spec.ts`
- `runs next-round transition without reload and clears scoreboard payload`
- `captures finish-game failure for retry and stores final leaderboard on success`
- `src/app/features/player/player-shell.component.spec.ts`
- `builds final leaderboard in finished status without legacy page hop`
Result:
- Test Files: 2 passed
- Tests: 9 passed
### `frontend` shared SPA tests (regression)
Result:
- Test Files: 5 passed
- Tests: 24 passed