Files
openclaw/src/acp/event-mapper.test.ts
Mariano 3c3474360b acp: harden follow-up reliability and attachments (#41464)
Merged via squash.

Prepared head SHA: 7d167dff54
Co-authored-by: mbelinky <132747814+mbelinky@users.noreply.github.com>
Co-authored-by: mbelinky <132747814+mbelinky@users.noreply.github.com>
Reviewed-by: @mbelinky
2026-03-09 23:03:50 +01:00

19 lines
670 B
TypeScript

import { describe, expect, it } from "vitest";
import { extractToolCallLocations } from "./event-mapper.js";
describe("extractToolCallLocations", () => {
it("enforces the global node visit cap across nested structures", () => {
const nested = Array.from({ length: 20 }, (_, outer) =>
Array.from({ length: 20 }, (_, inner) =>
inner === 19 ? { path: `/tmp/file-${outer}.txt` } : { note: `${outer}-${inner}` },
),
);
const locations = extractToolCallLocations(nested);
expect(locations).toBeDefined();
expect(locations?.length).toBeLessThan(20);
expect(locations).not.toContainEqual({ path: "/tmp/file-19.txt" });
});
});