mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
refactor(core): Move integration test utils for insights (#16693)
This commit is contained in:
@@ -1,14 +1,13 @@
|
||||
import { getPersonalProject, mockInstance } from '@n8n/backend-test-utils';
|
||||
import { testDb } from '@n8n/backend-test-utils';
|
||||
import { nanoid } from 'nanoid';
|
||||
|
||||
import { ImportCredentialsCommand } from '@/commands/import/credentials';
|
||||
import { LoadNodesAndCredentials } from '@/load-nodes-and-credentials';
|
||||
import { setupTestCommand } from '@test-integration/utils/test-command';
|
||||
|
||||
import { mockInstance } from '../../shared/mocking';
|
||||
import { getAllCredentials, getAllSharedCredentials } from '../shared/db/credentials';
|
||||
import { getPersonalProject } from '../shared/db/projects';
|
||||
import { createMember, createOwner } from '../shared/db/users';
|
||||
import * as testDb from '../shared/test-db';
|
||||
|
||||
mockInstance(LoadNodesAndCredentials);
|
||||
const command = setupTestCommand(ImportCredentialsCommand);
|
||||
|
||||
@@ -1,14 +1,13 @@
|
||||
import { mockInstance, testDb } from '@n8n/backend-test-utils';
|
||||
import { getPersonalProject } from '@n8n/backend-test-utils';
|
||||
import { getAllSharedWorkflows, getAllWorkflows } from '@n8n/backend-test-utils';
|
||||
import { nanoid } from 'nanoid';
|
||||
|
||||
import { ImportWorkflowsCommand } from '@/commands/import/workflow';
|
||||
import { LoadNodesAndCredentials } from '@/load-nodes-and-credentials';
|
||||
import { setupTestCommand } from '@test-integration/utils/test-command';
|
||||
|
||||
import { mockInstance } from '../../shared/mocking';
|
||||
import { getPersonalProject } from '../shared/db/projects';
|
||||
import { createMember, createOwner } from '../shared/db/users';
|
||||
import { getAllSharedWorkflows, getAllWorkflows } from '../shared/db/workflows';
|
||||
import * as testDb from '../shared/test-db';
|
||||
|
||||
mockInstance(LoadNodesAndCredentials);
|
||||
const command = setupTestCommand(ImportWorkflowsCommand);
|
||||
|
||||
@@ -1,3 +1,11 @@
|
||||
import {
|
||||
createTeamProject,
|
||||
findProject,
|
||||
getPersonalProject,
|
||||
mockInstance,
|
||||
} from '@n8n/backend-test-utils';
|
||||
import { createWorkflow } from '@n8n/backend-test-utils';
|
||||
import { randomCredentialPayload } from '@n8n/backend-test-utils';
|
||||
import { CredentialsRepository } from '@n8n/db';
|
||||
import { SharedCredentialsRepository } from '@n8n/db';
|
||||
import { SharedWorkflowRepository } from '@n8n/db';
|
||||
@@ -14,13 +22,9 @@ import { Push } from '@/push';
|
||||
import { Telemetry } from '@/telemetry';
|
||||
import { setupTestCommand } from '@test-integration/utils/test-command';
|
||||
|
||||
import { mockInstance } from '../../../shared/mocking';
|
||||
import { saveCredential } from '../../shared/db/credentials';
|
||||
import { createTeamProject, findProject, getPersonalProject } from '../../shared/db/projects';
|
||||
import { createLdapUser, createMember, getUserById } from '../../shared/db/users';
|
||||
import { createWorkflow } from '../../shared/db/workflows';
|
||||
import { createLdapConfig } from '../../shared/ldap';
|
||||
import { randomCredentialPayload } from '../../shared/random';
|
||||
|
||||
mockInstance(Telemetry);
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { mockInstance } from '@n8n/backend-test-utils';
|
||||
import { Container } from '@n8n/di';
|
||||
|
||||
import { ClearLicenseCommand } from '@/commands/license/clear';
|
||||
@@ -5,8 +6,6 @@ import { License } from '@/license';
|
||||
import { LoadNodesAndCredentials } from '@/load-nodes-and-credentials';
|
||||
import { setupTestCommand } from '@test-integration/utils/test-command';
|
||||
|
||||
import { mockInstance } from '../../shared/mocking';
|
||||
|
||||
mockInstance(LoadNodesAndCredentials);
|
||||
const command = setupTestCommand(ClearLicenseCommand);
|
||||
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
import { getPersonalProject, mockInstance } from '@n8n/backend-test-utils';
|
||||
import { createWorkflow } from '@n8n/backend-test-utils';
|
||||
import { testDb } from '@n8n/backend-test-utils';
|
||||
import { randomCredentialPayload } from '@n8n/backend-test-utils';
|
||||
import { CredentialsEntity, SettingsRepository } from '@n8n/db';
|
||||
import { CredentialsRepository } from '@n8n/db';
|
||||
import { SharedCredentialsRepository } from '@n8n/db';
|
||||
@@ -10,13 +14,8 @@ import { LoadNodesAndCredentials } from '@/load-nodes-and-credentials';
|
||||
import { NodeTypes } from '@/node-types';
|
||||
import { setupTestCommand } from '@test-integration/utils/test-command';
|
||||
|
||||
import { mockInstance } from '../../shared/mocking';
|
||||
import { encryptCredentialData, saveCredential } from '../shared/db/credentials';
|
||||
import { getPersonalProject } from '../shared/db/projects';
|
||||
import { createMember, createUser } from '../shared/db/users';
|
||||
import { createWorkflow } from '../shared/db/workflows';
|
||||
import { randomCredentialPayload } from '../shared/random';
|
||||
import * as testDb from '../shared/test-db';
|
||||
|
||||
mockInstance(LoadNodesAndCredentials);
|
||||
mockInstance(NodeTypes);
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
import { mockInstance, testDb } from '@n8n/backend-test-utils';
|
||||
import { createWorkflowWithTrigger, getAllWorkflows } from '@n8n/backend-test-utils';
|
||||
|
||||
import { UpdateWorkflowCommand } from '@/commands/update/workflow';
|
||||
import { LoadNodesAndCredentials } from '@/load-nodes-and-credentials';
|
||||
import { setupTestCommand } from '@test-integration/utils/test-command';
|
||||
|
||||
import { mockInstance } from '../../../shared/mocking';
|
||||
import { createWorkflowWithTrigger, getAllWorkflows } from '../../shared/db/workflows';
|
||||
import * as testDb from '../../shared/test-db';
|
||||
|
||||
mockInstance(LoadNodesAndCredentials);
|
||||
const command = setupTestCommand(UpdateWorkflowCommand);
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
process.argv[2] = 'worker';
|
||||
|
||||
import { mockInstance } from '@n8n/backend-test-utils';
|
||||
import { TaskRunnersConfig } from '@n8n/config';
|
||||
import { Container } from '@n8n/di';
|
||||
import { BinaryDataService } from 'n8n-core';
|
||||
@@ -21,8 +22,6 @@ import { TaskRunnerProcess } from '@/task-runners/task-runner-process';
|
||||
import { Telemetry } from '@/telemetry';
|
||||
import { setupTestCommand } from '@test-integration/utils/test-command';
|
||||
|
||||
import { mockInstance } from '../../shared/mocking';
|
||||
|
||||
config.set('executions.mode', 'queue');
|
||||
config.set('binaryDataManager.availableModes', 'filesystem');
|
||||
Container.get(TaskRunnersConfig).enabled = true;
|
||||
|
||||
Reference in New Issue
Block a user