feat: guard against empty terms in createGameSession
This commit is contained in:
parent
1e30f04e81
commit
3d16ab0fff
4 changed files with 62 additions and 0 deletions
|
|
@ -273,4 +273,12 @@ describe("evaluateAnswer", () => {
|
|||
),
|
||||
).rejects.toThrow("Game session not found");
|
||||
});
|
||||
|
||||
it("throws NotFoundError when getGameTerms returns no terms", async () => {
|
||||
mockGetGameTerms.mockResolvedValue([]);
|
||||
|
||||
await expect(
|
||||
createGameSession(validRequest, store, "user-1"),
|
||||
).rejects.toThrow("No terms found");
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue