fix: playtest bugs + comprehensive test coverage #2

Merged
TimCane merged 1 commit from features/post-demo-improvements into main 2026-04-20 21:42:28 +01:00
TimCane commented 2026-04-20 21:42:18 +01:00 (Migrated from github.com)

Bug fixes from playtest:

  • Toast errors now use toast.error() with top-center positioning and rich colors
  • Bingo squares show 3 lines of text (was 2) + detail dialog before camera
  • Socket connection check before emitting submission (prevents ghost pendings)
  • End Game button added to leader lobby with confirmation dialog
  • Three-state connection indicator (connected/reconnecting/disconnected) in headers
  • game:end now accepts LOBBY status (not just ACTIVE)

Code quality fixes:

  • gameReducer default case returns state for unknown actions
  • Removed redundant loadSession() call in useLeaderSocket
  • Runtime validation of localStorage session data (isValidSession guard)
  • Extracted board validators to src/lib/board-validation.ts

Test coverage (57 -> 352 tests):

  • 13 component test files (Square, Board, ConnectionBanner, dialogs, headers, etc.)
  • 11 utility/service test files (gameReducer, session, upload, socket-helpers, etc.)
  • 4 server socket handler test files (game, lobby, submission, location)
  • Socket handler disconnect/timeout tests with fake timers
  • Shared mock-socket test utility
Bug fixes from playtest: - Toast errors now use toast.error() with top-center positioning and rich colors - Bingo squares show 3 lines of text (was 2) + detail dialog before camera - Socket connection check before emitting submission (prevents ghost pendings) - End Game button added to leader lobby with confirmation dialog - Three-state connection indicator (connected/reconnecting/disconnected) in headers - game:end now accepts LOBBY status (not just ACTIVE) Code quality fixes: - gameReducer default case returns state for unknown actions - Removed redundant loadSession() call in useLeaderSocket - Runtime validation of localStorage session data (isValidSession guard) - Extracted board validators to src/lib/board-validation.ts Test coverage (57 -> 352 tests): - 13 component test files (Square, Board, ConnectionBanner, dialogs, headers, etc.) - 11 utility/service test files (gameReducer, session, upload, socket-helpers, etc.) - 4 server socket handler test files (game, lobby, submission, location) - Socket handler disconnect/timeout tests with fake timers - Shared mock-socket test utility
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
1st-Chertsey-Scout-Group/bingo!2
No description provided.