mirror of
https://github.com/lordmathis/lemma.git
synced 2025-12-25 10:54:23 +00:00
Add FolderSelector component and integrate with CreateFileModal
This commit is contained in:
@@ -29,6 +29,31 @@ vi.mock('../../../contexts/ModalContext', () => ({
|
||||
useModalContext: () => mockModalContext,
|
||||
}));
|
||||
|
||||
// Mock useFileList hook
|
||||
const mockLoadFileList = vi.fn();
|
||||
const mockFiles = [
|
||||
{
|
||||
id: '1',
|
||||
name: 'docs',
|
||||
path: 'docs',
|
||||
children: [
|
||||
{
|
||||
id: '2',
|
||||
name: 'guides',
|
||||
path: 'docs/guides',
|
||||
children: [],
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
|
||||
vi.mock('../../../hooks/useFileList', () => ({
|
||||
useFileList: () => ({
|
||||
files: mockFiles,
|
||||
loadFileList: mockLoadFileList,
|
||||
}),
|
||||
}));
|
||||
|
||||
// Helper wrapper component for testing
|
||||
const TestWrapper = ({ children }: { children: React.ReactNode }) => (
|
||||
<MantineProvider defaultColorScheme="light">{children}</MantineProvider>
|
||||
@@ -47,6 +72,8 @@ describe('CreateFileModal', () => {
|
||||
mockOnCreateFile.mockReset();
|
||||
mockOnCreateFile.mockResolvedValue(undefined);
|
||||
mockModalContext.setNewFileModalVisible.mockClear();
|
||||
mockLoadFileList.mockClear();
|
||||
mockLoadFileList.mockResolvedValue(undefined);
|
||||
});
|
||||
|
||||
describe('Modal Visibility and Content', () => {
|
||||
|
||||
Reference in New Issue
Block a user