mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-18 20:14:44 +00:00
test: compare camera image blocks
This commit is contained in:
@@ -105,10 +105,13 @@ function mockNodeList(params?: { commands?: string[]; remoteIp?: string }) {
|
||||
|
||||
function expectSingleImage(result: NodesToolResult, params?: { mimeType?: string }) {
|
||||
const images = (result.content ?? []).filter((block) => block.type === "image");
|
||||
expect(images).toHaveLength(1);
|
||||
if (params?.mimeType) {
|
||||
expect(images[0]?.mimeType).toBe(params.mimeType);
|
||||
}
|
||||
expect(images).toEqual([
|
||||
{
|
||||
type: "image",
|
||||
data: JPG_PAYLOAD.base64,
|
||||
mimeType: params?.mimeType ?? "image/jpeg",
|
||||
},
|
||||
]);
|
||||
}
|
||||
|
||||
function expectNoImages(result: NodesToolResult) {
|
||||
|
||||
Reference in New Issue
Block a user