test(spa): cover lobby->start-round flow without reload (#169)
All checks were successful
CI / test-and-quality (push) Successful in 2m4s
CI / test-and-quality (pull_request) Successful in 2m4s

This commit is contained in:
2026-03-01 13:17:38 +00:00
parent 538368de99
commit b52896d137

View File

@@ -156,4 +156,15 @@ describe('vertical slice controller: lobby -> join -> start round', () => {
expect(state.startRoundState).toBe('error');
expect(state.errorMessage).toContain('Kunne ikke starte runden');
});
it('uses joined session code when starting round without a reload', async () => {
const api = makeApiMock();
const controller = createVerticalSliceController(api);
await controller.joinLobby(' abcd12 ', 'Maja');
await controller.startRound('', 'history');
expect(api.startRound).toHaveBeenCalledWith('ABCD12', { category_slug: 'history' });
expect(controller.getState().sessionCode).toBe('ABCD12');
});
});