mirror of
https://github.com/Termix-SSH/Termix.git
synced 2026-10-29 14:45:24 +00:00
fix: add openapi docs and error handling to host tag routes
This commit is contained in:
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: [] });
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user