Fix unit test for updated openFile function signature

- 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 <noreply@anthropic.com>
This commit is contained in:
hannesrudolph 2025-06-11 21:21:35 -06:00
parent 91158c07be
commit 10967936f9

View file

@ -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()
})