From fc68e30cf4fa5b7c3743b8c35cf1fe2af02c751a Mon Sep 17 00:00:00 2001 From: DEV-bot Date: Mon, 16 Mar 2026 11:29:45 +0000 Subject: [PATCH] fix(frontend): restore phase-gating build --- frontend/src/api/client.ts | 10 +++++----- frontend/tests/vertical-slice.test.ts | 10 +++++++++- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/frontend/src/api/client.ts b/frontend/src/api/client.ts index 397365c..65ef550 100644 --- a/frontend/src/api/client.ts +++ b/frontend/src/api/client.ts @@ -4,8 +4,8 @@ import { mapHealthResponse, mapJoinSessionResponse, mapMixAnswersResponse, - mapNextRoundResponse, mapScoreboardResponse, + mapStartNextRoundResponse, mapSessionDetailResponse, mapShowQuestionResponse, mapStartRoundResponse, @@ -20,8 +20,8 @@ import type { JoinSessionRequest, JoinSessionResponse, MixAnswersResponse, - NextRoundResponse, ScoreboardResponse, + StartNextRoundResponse, SessionDetailResponse, ShowQuestionResponse, StartRoundRequest, @@ -41,7 +41,7 @@ export interface ApiClient { mixAnswers(code: string, roundQuestionId: number): Promise>; calculateScores(code: string, roundQuestionId: number): Promise>; getScoreboard(code: string): Promise>; - startNextRound(code: string): Promise>; + startNextRound(code: string): Promise>; finishGame(code: string): Promise>; submitLie(code: string, roundQuestionId: number, payload: SubmitLieRequest): Promise>; submitGuess(code: string, roundQuestionId: number, payload: SubmitGuessRequest): Promise>; @@ -167,10 +167,10 @@ export function createApiClient(baseUrl = '', fetchImpl: typeof fetch = fetch): mapScoreboardResponse ), startNextRound: (code: string) => - request( + request( `/lobby/sessions/${encodeURIComponent(normalizeCode(code))}/rounds/next`, 'POST', - mapNextRoundResponse, + mapStartNextRoundResponse, {} ), finishGame: (code: string) => diff --git a/frontend/tests/vertical-slice.test.ts b/frontend/tests/vertical-slice.test.ts index 81544ee..6c4336e 100644 --- a/frontend/tests/vertical-slice.test.ts +++ b/frontend/tests/vertical-slice.test.ts @@ -56,7 +56,15 @@ function makeApiMock(overrides?: Partial): ApiClient { session: { code: 'ABCD12', status: 'lie', current_round: 1 }, round: { number: 1, category: { slug: 'history', name: 'History' } } } - }) + }), + showQuestion: vi.fn(), + mixAnswers: vi.fn(), + calculateScores: vi.fn(), + getScoreboard: vi.fn(), + startNextRound: vi.fn(), + finishGame: vi.fn(), + submitLie: vi.fn(), + submitGuess: vi.fn() }; return { ...base, ...overrides };