test: update agent tool assertions and reclassify suites

This commit is contained in:
Peter Steinberger
2026-02-22 11:18:50 +00:00
parent fcb86408fd
commit 7d09a9e74d
4 changed files with 5 additions and 7 deletions

View File

@@ -25,7 +25,6 @@ describe("subscribeEmbeddedPiSession", () => {
const payload = onToolResult.mock.calls[0][0];
expect(payload.text).toContain("🖼️");
expect(payload.text).toContain("Canvas");
expect(payload.text).toContain("A2UI push");
expect(payload.text).toContain("/tmp/a2ui.jsonl");
});
it("skips tool summaries when shouldEmitToolResult is false", () => {

View File

@@ -136,7 +136,6 @@ describe("subscribeEmbeddedPiSession", () => {
const payload = onToolResult.mock.calls[0][0];
expect(payload.text).toContain("🌐");
expect(payload.text).toContain("Browser");
expect(payload.text).toContain("snapshot");
expect(payload.text).toContain("https://example.com");
});

View File

@@ -286,7 +286,7 @@ describe("createOpenClawCodingTools", () => {
expect(parentId?.type).toBe("string");
expect(parentId?.anyOf).toBeUndefined();
expect(count?.oneOf).toBeDefined();
expect(count?.oneOf).toBeUndefined();
});
it("avoids anyOf/oneOf/allOf in tool schemas", () => {
expect(findUnionKeywordOffenders(defaultTools)).toEqual([]);

View File

@@ -309,7 +309,7 @@ describe("browser tool snapshot labels", () => {
expect(toolCommonMocks.imageResultFromFile).toHaveBeenCalledWith(
expect.objectContaining({
path: "/tmp/snap.png",
extraText: expect.stringContaining("<<<EXTERNAL_UNTRUSTED_CONTENT>>>"),
extraText: expect.stringContaining("<<<EXTERNAL_UNTRUSTED_CONTENT"),
}),
);
expect(result).toEqual(imageResult);
@@ -346,7 +346,7 @@ describe("browser tool external content wrapping", () => {
const result = await tool.execute?.("call-1", { action: "snapshot", snapshotFormat: "aria" });
expect(result?.content?.[0]).toMatchObject({
type: "text",
text: expect.stringContaining("<<<EXTERNAL_UNTRUSTED_CONTENT>>>"),
text: expect.stringContaining("<<<EXTERNAL_UNTRUSTED_CONTENT"),
});
const ariaTextBlock = result?.content?.[0];
const ariaTextValue =
@@ -380,7 +380,7 @@ describe("browser tool external content wrapping", () => {
const result = await tool.execute?.("call-1", { action: "tabs" });
expect(result?.content?.[0]).toMatchObject({
type: "text",
text: expect.stringContaining("<<<EXTERNAL_UNTRUSTED_CONTENT>>>"),
text: expect.stringContaining("<<<EXTERNAL_UNTRUSTED_CONTENT"),
});
const tabsTextBlock = result?.content?.[0];
const tabsTextValue =
@@ -413,7 +413,7 @@ describe("browser tool external content wrapping", () => {
const result = await tool.execute?.("call-1", { action: "console" });
expect(result?.content?.[0]).toMatchObject({
type: "text",
text: expect.stringContaining("<<<EXTERNAL_UNTRUSTED_CONTENT>>>"),
text: expect.stringContaining("<<<EXTERNAL_UNTRUSTED_CONTENT"),
});
const consoleTextBlock = result?.content?.[0];
const consoleTextValue =