diff --git a/apps/web/src/__tests__/admin-gates-imports.test.ts b/apps/web/src/__tests__/admin-gates-imports.test.ts index 8148f92..5f1c834 100644 --- a/apps/web/src/__tests__/admin-gates-imports.test.ts +++ b/apps/web/src/__tests__/admin-gates-imports.test.ts @@ -6,3 +6,25 @@ test("imports POST rejects when missing admin token", async () => { expect(res.status).toBe(401); expect(res.body).toEqual({ error: "admin_required" }); }); + +test("imports upload rejects when missing admin token", async () => { + const { handleUploadImport } = await import("../../app/api/imports/handlers"); + const res = await handleUploadImport({ + adminOk: false, + params: { id: "00000000-0000-0000-0000-000000000000" }, + request: new Request("http://localhost/upload"), + }); + expect(res.status).toBe(401); + expect(res.body).toEqual({ error: "admin_required" }); +}); + +test("imports scan rejects when missing admin token", async () => { + const { handleScanMinioImport } = await import("../../app/api/imports/handlers"); + const res = await handleScanMinioImport({ + adminOk: false, + params: { id: "00000000-0000-0000-0000-000000000000" }, + body: {}, + }); + expect(res.status).toBe(401); + expect(res.body).toEqual({ error: "admin_required" }); +});