test: tighten runner image helper assertions

This commit is contained in:
Peter Steinberger
2026-05-08 15:55:59 +01:00
parent fc327378a0
commit e5dd03fb3d
3 changed files with 7 additions and 8 deletions

View File

@@ -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);
});
});

View File

@@ -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)", () => {

View File

@@ -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 });