test(spa): cover lobby->start-round flow without reload (#169)
This commit is contained in:
@@ -156,4 +156,15 @@ describe('vertical slice controller: lobby -> join -> start round', () => {
|
|||||||
expect(state.startRoundState).toBe('error');
|
expect(state.startRoundState).toBe('error');
|
||||||
expect(state.errorMessage).toContain('Kunne ikke starte runden');
|
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');
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user