From 099b11fc7d9c854c5f88caa1d891fb30eb22fae9 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Mon, 2 Mar 2026 12:20:51 +0000 Subject: [PATCH] test(perf): align media auto-detect no-key mock with scenario --- src/media-understanding/apply.test.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/media-understanding/apply.test.ts b/src/media-understanding/apply.test.ts index 2f4ea3359..286b62c26 100644 --- a/src/media-understanding/apply.test.ts +++ b/src/media-understanding/apply.test.ts @@ -240,7 +240,12 @@ describe("applyMediaUnderstanding", () => { }); beforeEach(() => { - mockedResolveApiKey.mockClear(); + mockedResolveApiKey.mockReset(); + mockedResolveApiKey.mockResolvedValue({ + apiKey: "test-key", + source: "test", + mode: "api-key", + }); mockedFetchRemoteMedia.mockClear(); mockedRunExec.mockReset(); mockedFetchRemoteMedia.mockResolvedValue({ @@ -495,6 +500,10 @@ describe("applyMediaUnderstanding", () => { content: "audio", }); const cfg: OpenClawConfig = { tools: { media: { audio: {} } } }; + mockedResolveApiKey.mockResolvedValue({ + source: "none", + mode: "api-key", + }); await withMediaAutoDetectEnv( {