fix(confidence-engine): decouple app health from provider
This commit is contained in:
@@ -103,23 +103,18 @@ describe("authenticated product boundary", () => {
|
||||
const response = await GET();
|
||||
|
||||
expect(mockGetAuthenticatedUser).not.toHaveBeenCalled();
|
||||
const body = await response.json();
|
||||
expect(body).toHaveProperty("healthy");
|
||||
// Must not expose private config details in the public response
|
||||
expect(JSON.stringify(body)).not.toContain("baseUrl");
|
||||
expect(JSON.stringify(body)).not.toContain("model");
|
||||
expect(JSON.stringify(body)).not.toContain("ollama");
|
||||
expect(response.status).toBe(200);
|
||||
await expect(response.json()).resolves.toEqual({ healthy: true });
|
||||
});
|
||||
|
||||
it("reports unhealthy generic state when config is missing", async () => {
|
||||
it("remains healthy when reasoning configuration is missing", async () => {
|
||||
mockGetConfig.mockReturnValue({ ok: false });
|
||||
const { GET } = await import("@/app/api/health/route.js");
|
||||
|
||||
const response = await GET();
|
||||
|
||||
expect(response.status).toBe(500);
|
||||
const body = await response.json();
|
||||
expect(body).toEqual({ healthy: false });
|
||||
expect(response.status).toBe(200);
|
||||
await expect(response.json()).resolves.toEqual({ healthy: true });
|
||||
});
|
||||
|
||||
it("does not convert /api/health to 401 via middleware when unauthenticated", async () => {
|
||||
|
||||
Reference in New Issue
Block a user