mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-09-05 08:10:14 +00:00
fix: add missing mock methods to presentAssistantMessage-custom-tool test
The ReadFileTool's execute method requires additional Task methods that were not mocked: - sayAndCreateMissingParamError: called when files array is empty/undefined - cwd: used for path resolution - apiConfiguration: used for protocol resolution - taskToolProtocol: used for protocol resolution - rooIgnoreController: used for access validation - fileContextTracker: used for tracking file context This fix ensures the test properly mocks all dependencies required by the ReadFileTool when invoked through presentAssistantMessage.
This commit is contained in:
parent
26890a5c28
commit
06e5cff342
1 changed files with 10 additions and 0 deletions
|
|
@ -76,6 +76,16 @@ describe("presentAssistantMessage - Custom Tool Recording", () => {
|
|||
},
|
||||
say: vi.fn().mockResolvedValue(undefined),
|
||||
ask: vi.fn().mockResolvedValue({ response: "yesButtonClicked" }),
|
||||
sayAndCreateMissingParamError: vi.fn().mockResolvedValue("Missing required parameter"),
|
||||
cwd: "/test/workspace",
|
||||
apiConfiguration: {},
|
||||
taskToolProtocol: "native",
|
||||
rooIgnoreController: {
|
||||
validateAccess: vi.fn().mockReturnValue(true),
|
||||
},
|
||||
fileContextTracker: {
|
||||
trackFileContext: vi.fn().mockResolvedValue(undefined),
|
||||
},
|
||||
}
|
||||
|
||||
// Add pushToolResultToUserContent method after mockTask is created so it can reference mockTask
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue