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 <noreply@paperclip.ing>
This commit is contained in:
@@ -252,15 +252,15 @@ describe("PATCH /portal/waitlist/:id", () => {
|
|||||||
selectSessionRow = ACTIVE_SESSION;
|
selectSessionRow = ACTIVE_SESSION;
|
||||||
selectRows = [WAITLIST_ENTRY];
|
selectRows = [WAITLIST_ENTRY];
|
||||||
const res = await jsonRequest("PATCH", `/portal/waitlist/${VALID_UUID_1}`, {
|
const res = await jsonRequest("PATCH", `/portal/waitlist/${VALID_UUID_1}`, {
|
||||||
status: "notified",
|
status: "cancelled",
|
||||||
}, { "X-Impersonation-Session-Id": VALID_UUID_5 });
|
}, { "X-Impersonation-Session-Id": VALID_UUID_5 });
|
||||||
expect(res.status).toBe(200);
|
expect(res.status).toBe(200);
|
||||||
expect(updatedValues[0]?.status).toBe("notified");
|
expect(updatedValues[0]?.status).toBe("cancelled");
|
||||||
});
|
});
|
||||||
|
|
||||||
it("returns 401 without session", async () => {
|
it("returns 401 without session", async () => {
|
||||||
const res = await jsonRequest("PATCH", `/portal/waitlist/${VALID_UUID_1}`, {
|
const res = await jsonRequest("PATCH", `/portal/waitlist/${VALID_UUID_1}`, {
|
||||||
status: "notified",
|
status: "cancelled",
|
||||||
});
|
});
|
||||||
expect(res.status).toBe(401);
|
expect(res.status).toBe(401);
|
||||||
});
|
});
|
||||||
@@ -269,7 +269,7 @@ describe("PATCH /portal/waitlist/:id", () => {
|
|||||||
selectSessionRow = { ...ACTIVE_SESSION, clientId: "other-client-uuid" };
|
selectSessionRow = { ...ACTIVE_SESSION, clientId: "other-client-uuid" };
|
||||||
selectRows = [WAITLIST_ENTRY];
|
selectRows = [WAITLIST_ENTRY];
|
||||||
const res = await jsonRequest("PATCH", `/portal/waitlist/${VALID_UUID_1}`, {
|
const res = await jsonRequest("PATCH", `/portal/waitlist/${VALID_UUID_1}`, {
|
||||||
status: "notified",
|
status: "cancelled",
|
||||||
}, { "X-Impersonation-Session-Id": VALID_UUID_5 });
|
}, { "X-Impersonation-Session-Id": VALID_UUID_5 });
|
||||||
expect(res.status).toBe(403);
|
expect(res.status).toBe(403);
|
||||||
});
|
});
|
||||||
@@ -278,7 +278,7 @@ describe("PATCH /portal/waitlist/:id", () => {
|
|||||||
selectSessionRow = ACTIVE_SESSION;
|
selectSessionRow = ACTIVE_SESSION;
|
||||||
selectRows = [];
|
selectRows = [];
|
||||||
const res = await jsonRequest("PATCH", "/portal/waitlist/nonexistent", {
|
const res = await jsonRequest("PATCH", "/portal/waitlist/nonexistent", {
|
||||||
status: "notified",
|
status: "cancelled",
|
||||||
}, { "X-Impersonation-Session-Id": VALID_UUID_5 });
|
}, { "X-Impersonation-Session-Id": VALID_UUID_5 });
|
||||||
expect(res.status).toBe(404);
|
expect(res.status).toBe(404);
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user