mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-19 19:11:13 +00:00
feat(editor): Add functionality to create folders (#13473)
This commit is contained in:
committed by
GitHub
parent
f381a24145
commit
2cb9d9e29f
@@ -3,7 +3,7 @@ import userEvent from '@testing-library/user-event';
|
||||
import FolderCard from './FolderCard.vue';
|
||||
import { createPinia, setActivePinia } from 'pinia';
|
||||
import type { FolderResource } from '../layouts/ResourcesListLayout.vue';
|
||||
import type { UserAction } from '@/Interface';
|
||||
import type { FolderPathItem, UserAction } from '@/Interface';
|
||||
|
||||
vi.mock('vue-router', () => {
|
||||
const push = vi.fn();
|
||||
@@ -61,6 +61,11 @@ const PARENT_FOLDER: FolderResource = {
|
||||
},
|
||||
} as const satisfies FolderResource;
|
||||
|
||||
const DEFAULT_BREADCRUMBS: { visibleItems: FolderPathItem[]; hiddenItems: FolderPathItem[] } = {
|
||||
visibleItems: [{ id: '1', label: 'Parent 2' }],
|
||||
hiddenItems: [{ id: '2', label: 'Parent 1', parentFolder: '1' }],
|
||||
};
|
||||
|
||||
const renderComponent = createComponentRenderer(FolderCard, {
|
||||
props: {
|
||||
data: DEFAULT_FOLDER,
|
||||
@@ -68,6 +73,7 @@ const renderComponent = createComponentRenderer(FolderCard, {
|
||||
{ label: 'Open', value: 'open', disabled: false },
|
||||
{ label: 'Delete', value: 'delete', disabled: false },
|
||||
] as const satisfies UserAction[],
|
||||
breadcrumbs: DEFAULT_BREADCRUMBS,
|
||||
},
|
||||
global: {
|
||||
stubs: {
|
||||
@@ -145,6 +151,10 @@ describe('FolderCard', () => {
|
||||
},
|
||||
parentFolder: PARENT_FOLDER,
|
||||
},
|
||||
breadcrumbs: {
|
||||
visibleItems: [{ id: PARENT_FOLDER.id, label: PARENT_FOLDER.name, parentFolder: '1' }],
|
||||
hiddenItems: [],
|
||||
},
|
||||
},
|
||||
});
|
||||
expect(getByTestId('folder-card-icon')).toBeInTheDocument();
|
||||
|
||||
Reference in New Issue
Block a user