From 10967936f986e3ceff9782d355943975100ac366 Mon Sep 17 00:00:00 2001 From: hannesrudolph Date: Wed, 11 Jun 2025 21:21:35 -0600 Subject: [PATCH] Fix unit test for updated openFile function signature MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Updated test expectation to match new preserveFocus parameter - Added ClineProvider mock for automated workflow detection - All mentions tests now pass 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- src/core/mentions/__tests__/index.test.ts | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/core/mentions/__tests__/index.test.ts b/src/core/mentions/__tests__/index.test.ts index d9399bb47d..be75aad1b8 100644 --- a/src/core/mentions/__tests__/index.test.ts +++ b/src/core/mentions/__tests__/index.test.ts @@ -99,6 +99,17 @@ jest.mock("../../../integrations/misc/open-file", () => ({ })) import { openFile } from "../../../integrations/misc/open-file" +jest.mock("../../webview/ClineProvider", () => ({ + ClineProvider: { + getVisibleInstance: jest.fn().mockReturnValue({ + getCurrentCline: jest.fn().mockReturnValue(null), + contextProxy: { + getValue: jest.fn().mockReturnValue(false), + }, + }), + }, +})) + jest.mock("../../../integrations/misc/extract-text", () => ({ extractTextFromFile: jest.fn(), })) @@ -256,7 +267,7 @@ Detailed commit message with multiple lines await openMention(mention) - expect(openFile).toHaveBeenCalledWith(expectedAbsPath) + expect(openFile).toHaveBeenCalledWith(expectedAbsPath, { preserveFocus: false }) expect(vscode.commands.executeCommand).not.toHaveBeenCalled() })