From 6803ba9a38b0f62a22e027a23eb2c51e5460f867 Mon Sep 17 00:00:00 2001 From: Ming Bao Date: Mon, 6 Oct 2025 12:08:57 +1300 Subject: [PATCH 1/2] test: finished testing 30 players joining --- backend/test/api.test.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/backend/test/api.test.ts b/backend/test/api.test.ts index 6587428..76bfb8a 100644 --- a/backend/test/api.test.ts +++ b/backend/test/api.test.ts @@ -220,4 +220,12 @@ describe("Api Tests", () => { const lobbyMessage = await waitForMessage(lobby!); expect(lobbyMessage).toBe("Cannot join when a game is running"); }); + + it("shouldn't allow players to join after game has started", async () => { + for (let i = 0; i <= 30; i++) { + new WebSocket( + `ws://localhost:3000/api/v1/lobby/join?name=joeJoin${i}&lobbyId=${lobbyCode}` + ); + } + }); }); From 05b8e3c0b1f60cd76c654cf123c9b7eb4026f56a Mon Sep 17 00:00:00 2001 From: Ming Bao Date: Mon, 6 Oct 2025 12:10:48 +1300 Subject: [PATCH 2/2] bug: changed test name to match test --- backend/test/api.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/test/api.test.ts b/backend/test/api.test.ts index 76bfb8a..c84a364 100644 --- a/backend/test/api.test.ts +++ b/backend/test/api.test.ts @@ -221,7 +221,7 @@ describe("Api Tests", () => { expect(lobbyMessage).toBe("Cannot join when a game is running"); }); - it("shouldn't allow players to join after game has started", async () => { + it("should allow 30 players to join a lobby", async () => { for (let i = 0; i <= 30; i++) { new WebSocket( `ws://localhost:3000/api/v1/lobby/join?name=joeJoin${i}&lobbyId=${lobbyCode}`