import { buildViewHistoryAction } from "./historyToolAction"; describe("buildViewHistoryAction", () => { it("preserves the scheme run ID from Agent tool parameters", () => { expect( buildViewHistoryAction({ feature_infos: [["P-1", "pipe"]], data_type: "scheme", run_id: " 99dd4142-368b-54cb-bfca-d59ee48f6298 ", }), ).toEqual( expect.objectContaining({ featureInfos: [["P-1", "pipe"]], dataType: "scheme", runId: "99dd4142-368b-54cb-bfca-d59ee48f6298", }), ); }); it("normalizes invalid history parameters", () => { expect( buildViewHistoryAction({ feature_infos: [["", "pipe"], "invalid"], data_type: "unexpected", runId: " ", }), ).toEqual({ type: "view_history", featureInfos: [], dataType: "realtime", runId: undefined, startTime: undefined, endTime: undefined, }); }); });