From c68159e97aa7421acce8949f0eb6e53af88a53b0 Mon Sep 17 00:00:00 2001 From: Flea Flicker Date: Thu, 26 Mar 2026 08:47:39 +0000 Subject: [PATCH] fix(waitlist): update portal PATCH tests to use allowed status value Now that portal clients are restricted to status:"cancelled" only, update the PATCH /portal/waitlist/:id tests to send a valid value so auth and ownership checks are exercised correctly. Co-Authored-By: Paperclip --- apps/api/src/__tests__/waitlist.test.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/api/src/__tests__/waitlist.test.ts b/apps/api/src/__tests__/waitlist.test.ts index 0bac557..383bc80 100644 --- a/apps/api/src/__tests__/waitlist.test.ts +++ b/apps/api/src/__tests__/waitlist.test.ts @@ -252,15 +252,15 @@ describe("PATCH /portal/waitlist/:id", () => { selectSessionRow = ACTIVE_SESSION; selectRows = [WAITLIST_ENTRY]; const res = await jsonRequest("PATCH", `/portal/waitlist/${VALID_UUID_1}`, { - status: "notified", + status: "cancelled", }, { "X-Impersonation-Session-Id": VALID_UUID_5 }); expect(res.status).toBe(200); - expect(updatedValues[0]?.status).toBe("notified"); + expect(updatedValues[0]?.status).toBe("cancelled"); }); it("returns 401 without session", async () => { const res = await jsonRequest("PATCH", `/portal/waitlist/${VALID_UUID_1}`, { - status: "notified", + status: "cancelled", }); expect(res.status).toBe(401); }); @@ -269,7 +269,7 @@ describe("PATCH /portal/waitlist/:id", () => { selectSessionRow = { ...ACTIVE_SESSION, clientId: "other-client-uuid" }; selectRows = [WAITLIST_ENTRY]; const res = await jsonRequest("PATCH", `/portal/waitlist/${VALID_UUID_1}`, { - status: "notified", + status: "cancelled", }, { "X-Impersonation-Session-Id": VALID_UUID_5 }); expect(res.status).toBe(403); }); @@ -278,7 +278,7 @@ describe("PATCH /portal/waitlist/:id", () => { selectSessionRow = ACTIVE_SESSION; selectRows = []; const res = await jsonRequest("PATCH", "/portal/waitlist/nonexistent", { - status: "notified", + status: "cancelled", }, { "X-Impersonation-Session-Id": VALID_UUID_5 }); expect(res.status).toBe(404); });