Precision pass on auth and resource analysis (#63)

This commit is contained in:
Eli Peter 2026-05-03 13:51:46 -04:00 committed by GitHub
parent 064801a3a4
commit c7c5e0f3a1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
62 changed files with 4248 additions and 138 deletions

View file

@ -0,0 +1,24 @@
// JS counterpart of ts-safe-022.
const { server } = require("./harness");
const { buildUser, buildTeam } = require("./factories");
describe("#comments.list", () => {
it("should require auth", async () => {
const res = await server.post("/api/comments.list");
const body = await res.json();
expect(res.status).toEqual(401);
});
it("should list comments", async () => {
const team = await buildTeam();
const user = await buildUser({ teamId: team.id });
const res = await server.post("/api/comments.list", {
body: {
token: user.getJwtToken(),
id: user.id,
},
});
const body = await res.json();
expect(res.status).toEqual(200);
});
});