mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-19 16:25:50 +00:00
test(media): accept minimax fetch abort signal
This commit is contained in:
parent
3d5668c305
commit
88dd641c6a
1 changed files with 15 additions and 11 deletions
|
|
@ -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();
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue