feat(FN-3368): tighten research view test coverage and resolve dashboard ty
This merge introduces an eval automation domain store with persistence schema and a plugin dashboard view registry (FN-3512/FN-3513), adds scheduled eval batch architecture documentation (FN-3388), and includes substantial test coverage for Research routes and hooks (FN-3368 steps 1-3). The branch a Fusion-Task-Id: FN-3368
This commit is contained in:
@@ -35,6 +35,7 @@ vi.mock("../../sse-bus", () => ({
|
||||
describe("useResearch", () => {
|
||||
beforeEach(() => {
|
||||
vi.clearAllMocks();
|
||||
vi.useRealTimers();
|
||||
mockListResearchRuns.mockResolvedValue({ runs: [], availability: { available: true } });
|
||||
mockGetResearchRun.mockResolvedValue({ run: { id: "RR-2", title: "t" }, availability: { available: true } });
|
||||
});
|
||||
@@ -223,4 +224,32 @@ describe("useResearch", () => {
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
it("refreshes list and selected run on reconnect", async () => {
|
||||
let handlers: { onReconnect?: () => void; events?: Record<string, () => void> } = {};
|
||||
mockSubscribeSse.mockImplementationOnce((_url, opts) => {
|
||||
handlers = opts;
|
||||
return vi.fn();
|
||||
});
|
||||
|
||||
const { result } = renderHook(() => useResearch({ projectId: "p1" }));
|
||||
|
||||
act(() => {
|
||||
result.current.setSelectedRunId("RR-2");
|
||||
});
|
||||
|
||||
await waitFor(() => {
|
||||
expect(mockGetResearchRun).toHaveBeenCalledWith("RR-2", "p1");
|
||||
});
|
||||
|
||||
const listCallsBefore = mockListResearchRuns.mock.calls.length;
|
||||
|
||||
act(() => {
|
||||
handlers.onReconnect?.();
|
||||
});
|
||||
|
||||
await waitFor(() => {
|
||||
expect(mockListResearchRuns.mock.calls.length).toBeGreaterThan(listCallsBefore);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user