Copilot commented on code in PR #5605:
URL: https://github.com/apache/texera/pull/5605#discussion_r3391595479
##########
agent-service/src/server.test.ts:
##########
@@ -112,8 +129,22 @@ describe(`POST ${API}/agents`, () => {
expect(body.error).toBe("Invalid or expired token");
});
+ test("rejects missing userToken", async () => {
+ const res = await postJson(`${API}/agents`, { modelType: "m" });
+ // Body schema violation; the exact status depends on the Elysia version
but
+ // it is always a 4xx or 5xx, never a successful 2xx.
+ expect(res.status).toBeGreaterThanOrEqual(400);
+ });
Review Comment:
This test currently allows a 5xx response for a client-side body schema
violation (missing `userToken`). A 5xx here would indicate a server bug; the
test should assert the status is a 4xx to prevent regressions where validation
errors become 500s.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]