fix(tests): section-prefix tool API URLs across overhauled suite

#276's overhauled integration tests + QA sweep scripts hit the old
sectionless /api/v1/tools/<id> routes, which 404 after #280 made routes
section-prefixed. Ran scripts/rewrite-tool-paths.ts for literal URLs and
converted dynamic /api/v1/tools/${id} constructions to apiToolPath().
Negative-test paths (nonexistent/fake tools) intentionally left raw.
This commit is contained in:
SnapOtter
2026-06-21 02:30:58 +08:00
parent 5ffa1d55ea
commit d4dc2eae5d
10 changed files with 187 additions and 180 deletions
+3 -2
View File
@@ -10,6 +10,7 @@
* If 501, the describe is skipped. If 200/202, we proceed with assertions.
*/
import { apiToolPath } from "@snapotter/shared";
import { afterAll, beforeAll, describe, expect, it } from "vitest";
import { fixtures, readFixture } from "../../fixtures/index.js";
import {
@@ -43,7 +44,7 @@ async function isBundleInstalled(
]);
const res = await app.inject({
method: "POST",
url: `/api/v1/tools/${toolId}`,
url: apiToolPath(toolId),
headers: {
authorization: `Bearer ${adminToken}`,
"content-type": contentType,
@@ -81,7 +82,7 @@ async function postTool(
]);
return app.inject({
method: "POST",
url: `/api/v1/tools/${toolId}`,
url: apiToolPath(toolId),
headers: {
authorization: `Bearer ${adminToken}`,
"content-type": contentType,