mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
fix(editor): Optimize workflow selector search performance by implementing pagination (#19252)
Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -13,6 +13,8 @@ import { createEventBus } from '@n8n/utils/event-bus';
|
||||
import { createMockEnterpriseSettings } from '@/__tests__/mocks';
|
||||
import { useWorkflowsStore } from '@/stores/workflows.store';
|
||||
import type { INodeParameterResourceLocator } from 'n8n-workflow';
|
||||
import type { IWorkflowDb, WorkflowListResource } from '@/Interface';
|
||||
import { mock } from 'vitest-mock-extended';
|
||||
|
||||
function getNdvStateMock(): Partial<ReturnType<typeof useNDVStore>> {
|
||||
return {
|
||||
@@ -379,19 +381,19 @@ describe('ParameterInput.vue', () => {
|
||||
value: workflowId,
|
||||
};
|
||||
|
||||
workflowsStore.allWorkflows = [
|
||||
{
|
||||
workflowsStore.fetchWorkflowsPage.mockResolvedValue([
|
||||
mock<WorkflowListResource>({
|
||||
id: workflowId,
|
||||
name: 'Test',
|
||||
active: false,
|
||||
isArchived: false,
|
||||
createdAt: new Date().toISOString(),
|
||||
updatedAt: new Date().toISOString(),
|
||||
nodes: [],
|
||||
connections: {},
|
||||
// nodes: [],
|
||||
// connections: {},
|
||||
versionId: faker.string.uuid(),
|
||||
},
|
||||
];
|
||||
}),
|
||||
]);
|
||||
|
||||
const { emitted, container, getByTestId, queryByTestId } = renderComponent({
|
||||
props: {
|
||||
@@ -432,19 +434,17 @@ describe('ParameterInput.vue', () => {
|
||||
value: workflowId,
|
||||
};
|
||||
|
||||
workflowsStore.allWorkflows = [
|
||||
{
|
||||
id: workflowId,
|
||||
name: 'Test',
|
||||
active: false,
|
||||
isArchived: true,
|
||||
createdAt: new Date().toISOString(),
|
||||
updatedAt: new Date().toISOString(),
|
||||
nodes: [],
|
||||
connections: {},
|
||||
versionId: faker.string.uuid(),
|
||||
},
|
||||
];
|
||||
const workflowBase = {
|
||||
id: workflowId,
|
||||
name: 'Test',
|
||||
active: false,
|
||||
isArchived: true,
|
||||
createdAt: new Date().toISOString(),
|
||||
updatedAt: new Date().toISOString(),
|
||||
versionId: faker.string.uuid(),
|
||||
};
|
||||
workflowsStore.allWorkflows = [mock<IWorkflowDb>(workflowBase)];
|
||||
workflowsStore.fetchWorkflowsPage.mockResolvedValue([mock<WorkflowListResource>(workflowBase)]);
|
||||
|
||||
const { emitted, container, getByTestId } = renderComponent({
|
||||
props: {
|
||||
|
||||
Reference in New Issue
Block a user