mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-12 09:41:11 +00:00
test(media): accept minimax fetch abort signal
This commit is contained in:
@@ -110,18 +110,22 @@ describe("describeImageWithModel", () => {
|
||||
expect(getApiKeyForModelMock).toHaveBeenCalled();
|
||||
expect(requireApiKeyMock).toHaveBeenCalled();
|
||||
expect(setRuntimeApiKeyMock).toHaveBeenCalledWith("minimax-portal", "oauth-test");
|
||||
expect(fetchMock).toHaveBeenCalledWith("https://api.minimax.io/v1/coding_plan/vlm", {
|
||||
method: "POST",
|
||||
headers: {
|
||||
Authorization: "Bearer oauth-test",
|
||||
"Content-Type": "application/json",
|
||||
"MM-API-Source": "OpenClaw",
|
||||
},
|
||||
body: JSON.stringify({
|
||||
prompt: "Describe the image.",
|
||||
image_url: `data:image/png;base64,${Buffer.from("png-bytes").toString("base64")}`,
|
||||
expect(fetchMock).toHaveBeenCalledWith(
|
||||
"https://api.minimax.io/v1/coding_plan/vlm",
|
||||
expect.objectContaining({
|
||||
method: "POST",
|
||||
headers: {
|
||||
Authorization: "Bearer oauth-test",
|
||||
"Content-Type": "application/json",
|
||||
"MM-API-Source": "OpenClaw",
|
||||
},
|
||||
body: JSON.stringify({
|
||||
prompt: "Describe the image.",
|
||||
image_url: `data:image/png;base64,${Buffer.from("png-bytes").toString("base64")}`,
|
||||
}),
|
||||
signal: expect.any(AbortSignal),
|
||||
}),
|
||||
});
|
||||
);
|
||||
expect(completeMock).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user