test(FN-3729): add eval dashboard coverage

- Add EvalsView test coverage for eval runs entry rendering
- Add useEvals hook tests for response handling
- Add dashboard eval routes tests to verify API behavior
- Wire EvalsView with the additional exercised path

Fusion-Task-Id: FN-3729
This commit is contained in:
Fusion
2026-05-08 04:21:17 -07:00
committed by gsxdsm
parent 9d470c706b
commit 4192220462
4 changed files with 87 additions and 0 deletions

View File

@@ -105,4 +105,15 @@ describe("useEvals", () => {
setIntervalSpy.mockRestore();
clearIntervalSpy.mockRestore();
});
it("surfaces API errors in error state", async () => {
mockListEvals.mockRejectedValueOnce(new Error("Network error"));
const { result } = renderHook(() => useEvals({ projectId: "p1" }));
await waitFor(() => {
expect(result.current.error).toBe("Network error");
expect(result.current.loading).toBe(false);
});
});
});