test: repair stale task and image mocks

This commit is contained in:
Peter Steinberger
2026-03-31 15:47:21 +01:00
parent c425ef3e74
commit a1e2d2bf42
4 changed files with 19 additions and 19 deletions

View File

@@ -226,10 +226,10 @@ describe("describeImageWithModel", () => {
it("normalizes deprecated google flash ids before lookup and keeps profile auth selection", async () => {
const findMock = vi.fn((provider: string, modelId: string) => {
expect(provider).toBe("google");
expect(modelId).toBe("gemini-3.1-flash-preview");
expect(modelId).toBe("gemini-3-flash-preview");
return {
provider: "google",
id: "gemini-3.1-flash-preview",
id: "gemini-3-flash-preview",
input: ["text", "image"],
baseUrl: "https://generativelanguage.googleapis.com/v1beta",
};
@@ -239,7 +239,7 @@ describe("describeImageWithModel", () => {
role: "assistant",
api: "google-generative-ai",
provider: "google",
model: "gemini-3.1-flash-preview",
model: "gemini-3-flash-preview",
stopReason: "stop",
timestamp: Date.now(),
content: [{ type: "text", text: "flash ok" }],
@@ -260,7 +260,7 @@ describe("describeImageWithModel", () => {
expect(result).toEqual({
text: "flash ok",
model: "gemini-3.1-flash-preview",
model: "gemini-3-flash-preview",
});
expect(findMock).toHaveBeenCalledOnce();
expect(getApiKeyForModelMock).toHaveBeenCalledWith(
@@ -274,10 +274,10 @@ describe("describeImageWithModel", () => {
it("normalizes gemini 3.1 flash-lite ids before lookup and keeps profile auth selection", async () => {
const findMock = vi.fn((provider: string, modelId: string) => {
expect(provider).toBe("google");
expect(modelId).toBe("gemini-3.1-flash-lite");
expect(modelId).toBe("gemini-3.1-flash-lite-preview");
return {
provider: "google",
id: "gemini-3.1-flash-lite",
id: "gemini-3.1-flash-lite-preview",
input: ["text", "image"],
baseUrl: "https://generativelanguage.googleapis.com/v1beta",
};
@@ -287,7 +287,7 @@ describe("describeImageWithModel", () => {
role: "assistant",
api: "google-generative-ai",
provider: "google",
model: "gemini-3.1-flash-lite",
model: "gemini-3.1-flash-lite-preview",
stopReason: "stop",
timestamp: Date.now(),
content: [{ type: "text", text: "flash lite ok" }],
@@ -308,7 +308,7 @@ describe("describeImageWithModel", () => {
expect(result).toEqual({
text: "flash lite ok",
model: "gemini-3.1-flash-lite",
model: "gemini-3.1-flash-lite-preview",
});
expect(findMock).toHaveBeenCalledOnce();
expect(getApiKeyForModelMock).toHaveBeenCalledWith(