feat(FN-801): show hidden files in workspace file listings
- Remove dotfile filtering from file-service so hidden files appear in workspace browser - Update FileBrowserModal and TaskDetailModal UI to display hidden file entries - Add UI/hook tests for hidden file entries in FileBrowserModal and useWorkspaceFileBrowser - Add file-service unit tests for listing, reading, and filtering hidden files - Update dashboard styles for hidden file display - Document Files feature section in README
This commit is contained in:
@@ -71,4 +71,26 @@ describe("useWorkspaceFileBrowser", () => {
|
||||
expect(result.current.error).toBe("Failed to load files");
|
||||
expect(result.current.entries).toEqual([]);
|
||||
});
|
||||
|
||||
it("returns hidden files and directories from the API response", async () => {
|
||||
const mockResponse: FileListResponse = {
|
||||
path: ".",
|
||||
entries: [
|
||||
{ name: ".env.example", type: "file", size: 42, mtime: "2024-01-01T00:00:00Z" },
|
||||
{ name: ".github", type: "directory", mtime: "2024-01-01T00:00:00Z" },
|
||||
{ name: "src", type: "directory", mtime: "2024-01-01T00:00:00Z" },
|
||||
],
|
||||
};
|
||||
mockFetchWorkspaceFileList.mockResolvedValueOnce(mockResponse);
|
||||
|
||||
const { result } = renderHook(() => useWorkspaceFileBrowser("project", true));
|
||||
|
||||
await waitFor(() => expect(result.current.loading).toBe(false));
|
||||
|
||||
expect(result.current.entries).toEqual(mockResponse.entries);
|
||||
const names = result.current.entries.map((e) => e.name);
|
||||
expect(names).toContain(".env.example");
|
||||
expect(names).toContain(".github");
|
||||
expect(names).toContain("src");
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user