fix: add openapi docs and error handling to host tag routes

This commit is contained in:
LukeGus committed 2026-10-03 15:45:41 -05:00
1 parent a1b37c6829
commit 7156ac1af3
2 files changed
+121 -28

No files matched your search

@@ -11,6 +11,9 @@ vi.mock("../../../database/repositories/factory.js", () => ({
},
}),
}));
vi.mock("../../../utils/logger.js", () => ({
databaseLogger: { error: vi.fn() },
}));
import { registerHostTagRoutes } from "../../../database/routes/host-tag-routes.js";
function app() {
@@ -68,4 +71,12 @@ describe("instance host tag catalog", () => {
.send({ tags: [] })
.expect(200, { tags: [] });
});
it("reads a damaged catalog as empty instead of failing", async () => {
settings.set("host_tag_catalog", "{not json");
await request(app())
.get("/tags")
.set("Authorization", "member")
.expect(200, { tags: [] });
});
});