Reduce output of config validation errors

This commit is contained in:
shamoon
2026-06-02 20:59:58 -07:00
parent 91f3b9df5c
commit cbb5667512
4 changed files with 41 additions and 12 deletions
+3 -4
View File
@@ -324,13 +324,12 @@ describe("pages/index Index routing + SWR branches", () => {
});
it("renders config errors when /api/validate returns a list of errors", async () => {
state.validateData = [{ config: "services.yaml", reason: "broken", mark: { snippet: "x: y" } }];
state.validateData = [{ config: "services.yaml", name: "Service 1", reason: "broken", mark: { line: 4 } }];
await renderIndex({ initialSettings: { title: "Homepage", layout: {} }, settings: { layout: {} } });
expect(screen.getByText("services.yaml")).toBeInTheDocument();
expect(screen.getByText("broken")).toBeInTheDocument();
expect(screen.getByText("x: y")).toBeInTheDocument();
expect(screen.getByText(/services.yaml/)).toBeInTheDocument();
expect(screen.getByText(/line 4/)).toBeInTheDocument();
});
it("marks the UI stale when the hash changes and triggers a revalidate reload", async () => {