CodeIssuesDiscussionsWikiPull RequestsProjectsCommitsActionsReleasesContributorsPulse● GatesSecuritySettingsDeploymentsPipelineInsightsAgents✨ Explain✨ Ask AI✨ Workspace✨ Spec✨ Tests▓ Debt Map✨ NL Search🏛 Archaeology
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 | /**
* Block E1 — Projects / kanban smoke tests.
*/
import { describe, it, expect } from "bun:test";
import app from "../app";
describe("projects — route smoke", () => {
it("GET /:owner/:repo/projects on missing repo → 404", async () => {
const res = await app.request("/nobody/missing/projects");
expect(res.status).toBe(404);
});
it("GET /:owner/:repo/projects/new without auth → 302 /login", async () => {
const res = await app.request("/any/repo/projects/new");
expect(res.status).toBe(302);
expect(res.headers.get("location") || "").toMatch(/^\/login/);
});
it("POST /:owner/:repo/projects without auth → 302 /login", async () => {
const res = await app.request("/any/repo/projects", {
method: "POST",
body: new URLSearchParams({ title: "x" }),
headers: { "content-type": "application/x-www-form-urlencoded" },
});
expect(res.status).toBe(302);
expect(res.headers.get("location") || "").toMatch(/^\/login/);
});
it("POST /:owner/:repo/projects/1/columns without auth → 302 /login", async () => {
const res = await app.request("/any/repo/projects/1/columns", {
method: "POST",
body: new URLSearchParams({ name: "Later" }),
headers: { "content-type": "application/x-www-form-urlencoded" },
});
expect(res.status).toBe(302);
expect(res.headers.get("location") || "").toMatch(/^\/login/);
});
it("POST /:owner/:repo/projects/1/items without auth → 302 /login", async () => {
const res = await app.request("/any/repo/projects/1/items", {
method: "POST",
body: new URLSearchParams({ column_id: "x", title: "card" }),
headers: { "content-type": "application/x-www-form-urlencoded" },
});
expect(res.status).toBe(302);
expect(res.headers.get("location") || "").toMatch(/^\/login/);
});
it("POST close without auth → 302 /login", async () => {
const res = await app.request("/any/repo/projects/1/close", {
method: "POST",
});
expect(res.status).toBe(302);
expect(res.headers.get("location") || "").toMatch(/^\/login/);
});
});
|