mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-18 09:54:45 +00:00
test: tighten runner image helper assertions
This commit is contained in:
@@ -963,10 +963,11 @@ describe("image dimension errors", () => {
|
||||
const raw =
|
||||
'400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.84.content.1.image.source.base64.data: At least one of the image dimensions exceed max allowed size for many-image requests: 2000 pixels"}}';
|
||||
const parsed = parseImageDimensionError(raw);
|
||||
expect(parsed).not.toBeNull();
|
||||
expect(parsed?.maxDimensionPx).toBe(2000);
|
||||
expect(parsed?.messageIndex).toBe(84);
|
||||
expect(parsed?.contentIndex).toBe(1);
|
||||
expect(parsed).toMatchObject({
|
||||
maxDimensionPx: 2000,
|
||||
messageIndex: 84,
|
||||
contentIndex: 1,
|
||||
});
|
||||
expect(isImageDimensionErrorMessage(raw)).toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1072,8 +1072,7 @@ describe("runEmbeddedPiAgent incomplete-turn safety", () => {
|
||||
}),
|
||||
});
|
||||
|
||||
expect(incompleteTurnText).not.toBeNull();
|
||||
expect(incompleteTurnText).toContain("couldn't generate a response");
|
||||
expect(incompleteTurnText).toEqual(expect.stringContaining("couldn't generate a response"));
|
||||
});
|
||||
|
||||
it("surfaces tool-use terminal with pre-tool text and side effects as replay-unsafe (#76477)", () => {
|
||||
|
||||
@@ -267,8 +267,7 @@ describe("loadImageFromRef", () => {
|
||||
},
|
||||
);
|
||||
|
||||
expect(image).not.toBeNull();
|
||||
expect(image?.type).toBe("image");
|
||||
expect(image).toMatchObject({ type: "image" });
|
||||
expect(image?.data.length).toBeGreaterThan(0);
|
||||
} finally {
|
||||
await fs.rm(sandboxParent, { recursive: true, force: true });
|
||||
|
||||
Reference in New Issue
Block a user