Skip to content

Commit 1096793

Browse files
hannesrudolphclaude
andcommitted
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 <[email protected]>
1 parent 91158c0 commit 1096793

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/core/mentions/__tests__/index.test.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,17 @@ jest.mock("../../../integrations/misc/open-file", () => ({
9999
}))
100100
import { openFile } from "../../../integrations/misc/open-file"
101101

102+
jest.mock("../../webview/ClineProvider", () => ({
103+
ClineProvider: {
104+
getVisibleInstance: jest.fn().mockReturnValue({
105+
getCurrentCline: jest.fn().mockReturnValue(null),
106+
contextProxy: {
107+
getValue: jest.fn().mockReturnValue(false),
108+
},
109+
}),
110+
},
111+
}))
112+
102113
jest.mock("../../../integrations/misc/extract-text", () => ({
103114
extractTextFromFile: jest.fn(),
104115
}))
@@ -256,7 +267,7 @@ Detailed commit message with multiple lines
256267

257268
await openMention(mention)
258269

259-
expect(openFile).toHaveBeenCalledWith(expectedAbsPath)
270+
expect(openFile).toHaveBeenCalledWith(expectedAbsPath, { preserveFocus: false })
260271
expect(vscode.commands.executeCommand).not.toHaveBeenCalled()
261272
})
262273

0 commit comments

Comments
 (0)