mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-09-06 08:18:39 +00:00
test: add unit test for workspaceFilesMode folders-only mode
This commit is contained in:
parent
308307aceb
commit
e29f38ca72
1 changed files with 24 additions and 0 deletions
|
|
@ -194,6 +194,30 @@ describe("getEnvironmentDetails", () => {
|
|||
expect(formatResponse.formatFilesList).not.toHaveBeenCalled()
|
||||
})
|
||||
|
||||
it("should use folders-only mode when workspaceFilesMode is 'folders'", async () => {
|
||||
mockProvider.getState.mockResolvedValue({
|
||||
...mockState,
|
||||
workspaceFilesMode: "folders",
|
||||
})
|
||||
|
||||
const result = await getEnvironmentDetails(mockCline as Task, true)
|
||||
|
||||
expect(result).toContain("# Current Workspace Directory")
|
||||
expect(result).toContain("Folder Structure")
|
||||
|
||||
expect(listFiles).toHaveBeenCalledWith(mockCwd, true, 50, true)
|
||||
|
||||
expect(formatResponse.formatFilesList).toHaveBeenCalledWith(
|
||||
mockCwd,
|
||||
["file1.ts", "file2.ts"],
|
||||
false,
|
||||
mockCline.rooIgnoreController,
|
||||
false,
|
||||
undefined,
|
||||
true,
|
||||
)
|
||||
})
|
||||
|
||||
it("should handle desktop directory specially", async () => {
|
||||
;(arePathsEqual as Mock).mockReturnValue(true)
|
||||
const result = await getEnvironmentDetails(mockCline as Task, true)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue