refactor(core): Streamline flows in multi-main mode (no-changelog) (#8446)

This commit is contained in:
Iván Ovejero
2024-02-05 09:26:55 +01:00
committed by GitHub
parent da1fe44d52
commit dc5ec8f946
12 changed files with 205 additions and 283 deletions

View File

@@ -83,35 +83,4 @@ describe('update()', () => {
expect(addSpy).not.toHaveBeenCalled();
});
test('should broadcast active workflow state change if state changed', async () => {
const owner = await createOwner();
const workflow = await createWorkflow({ active: true }, owner);
const publishSpy = jest.spyOn(orchestrationService, 'publish');
workflow.active = false;
await workflowService.update(owner, workflow, workflow.id);
expect(publishSpy).toHaveBeenCalledTimes(1);
expect(publishSpy).toHaveBeenCalledWith(
'workflowActiveStateChanged',
expect.objectContaining({
newState: false,
oldState: true,
workflowId: workflow.id,
}),
);
});
test('should not broadcast active workflow state change if state did not change', async () => {
const owner = await createOwner();
const workflow = await createWorkflow({ active: true }, owner);
const publishSpy = jest.spyOn(orchestrationService, 'publish');
await workflowService.update(owner, workflow, workflow.id);
expect(publishSpy).not.toHaveBeenCalled();
});
});