mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
refactor(core): Simplify OrchestrationService (no-changelog) (#8364)
This commit is contained in:
@@ -4,7 +4,7 @@ import { ActiveWorkflowRunner } from '@/ActiveWorkflowRunner';
|
||||
import { SharedWorkflowRepository } from '@db/repositories/sharedWorkflow.repository';
|
||||
import { WorkflowRepository } from '@db/repositories/workflow.repository';
|
||||
import { Telemetry } from '@/telemetry';
|
||||
import { MultiMainSetup } from '@/services/orchestration/main/MultiMainSetup.ee';
|
||||
import { OrchestrationService } from '@/services/orchestration.service';
|
||||
import { WorkflowService } from '@/workflows/workflow.service';
|
||||
|
||||
import * as testDb from '../shared/testDb';
|
||||
@@ -14,13 +14,13 @@ import { createWorkflow } from '../shared/db/workflows';
|
||||
|
||||
let workflowService: WorkflowService;
|
||||
let activeWorkflowRunner: ActiveWorkflowRunner;
|
||||
let multiMainSetup: MultiMainSetup;
|
||||
let orchestrationService: OrchestrationService;
|
||||
|
||||
beforeAll(async () => {
|
||||
await testDb.init();
|
||||
|
||||
activeWorkflowRunner = mockInstance(ActiveWorkflowRunner);
|
||||
multiMainSetup = mockInstance(MultiMainSetup);
|
||||
orchestrationService = mockInstance(OrchestrationService);
|
||||
mockInstance(Telemetry);
|
||||
|
||||
workflowService = new WorkflowService(
|
||||
@@ -33,7 +33,7 @@ beforeAll(async () => {
|
||||
mock(),
|
||||
mock(),
|
||||
mock(),
|
||||
multiMainSetup,
|
||||
orchestrationService,
|
||||
mock(),
|
||||
activeWorkflowRunner,
|
||||
);
|
||||
@@ -89,7 +89,7 @@ describe('update()', () => {
|
||||
const owner = await createOwner();
|
||||
const workflow = await createWorkflow({ active: true }, owner);
|
||||
|
||||
const publishSpy = jest.spyOn(multiMainSetup, 'publish');
|
||||
const publishSpy = jest.spyOn(orchestrationService, 'publish');
|
||||
|
||||
workflow.active = false;
|
||||
await workflowService.update(owner, workflow, workflow.id);
|
||||
@@ -109,7 +109,7 @@ describe('update()', () => {
|
||||
const owner = await createOwner();
|
||||
const workflow = await createWorkflow({ active: true }, owner);
|
||||
|
||||
const publishSpy = jest.spyOn(multiMainSetup, 'publish');
|
||||
const publishSpy = jest.spyOn(orchestrationService, 'publish');
|
||||
|
||||
await workflowService.update(owner, workflow, workflow.id);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user