test(api): section-prefix tool URLs across integration, docker, and e2e api specs

This commit is contained in:
SnapOtter
2026-06-20 12:24:50 +08:00
parent fc205c7428
commit f80444791b
213 changed files with 2868 additions and 2846 deletions
+3 -3
View File
@@ -1,4 +1,4 @@
import { TOOLS } from "@snapotter/shared";
import { apiToolPath, TOOLS } from "@snapotter/shared";
import { afterAll, beforeAll, describe, expect, it } from "vitest";
import { getRegisteredToolIds, getToolConfig } from "../../apps/api/src/routes/tool-factory.js";
import { buildTestApp, loginAsAdmin, type TestApp } from "./test-server.js";
@@ -96,11 +96,11 @@ describe("tool route drift", () => {
}
});
it("every TOOLS entry answers on POST /api/v1/tools/:toolId (no dead routes)", async () => {
it("every TOOLS entry answers on POST /api/v1/tools/:section/:toolId (no dead routes)", async () => {
for (const tool of TOOLS) {
const res = await testApp.app.inject({
method: "POST",
url: `/api/v1/tools/${tool.id}`,
url: apiToolPath(tool.id),
headers: { authorization: `Bearer ${adminToken}`, "content-type": "application/json" },
payload: {},
});