refactor(core): Use DI for WorkflowRunner (no-changelog) (#8372)

This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™
2024-01-26 13:49:39 +01:00
committed by GitHub
parent bf11c7c1bd
commit c70fa66e76
21 changed files with 215 additions and 258 deletions

View File

@@ -21,7 +21,7 @@ describe('WaitTracker', () => {
it('should query DB for waiting executions', async () => {
executionRepository.getWaitingExecutions.mockResolvedValue([execution]);
new WaitTracker(mock(), executionRepository, mock());
new WaitTracker(mock(), executionRepository, mock(), mock());
expect(executionRepository.getWaitingExecutions).toHaveBeenCalledTimes(1);
});
@@ -29,7 +29,7 @@ describe('WaitTracker', () => {
it('if no executions to start, should do nothing', () => {
executionRepository.getWaitingExecutions.mockResolvedValue([]);
new WaitTracker(mock(), executionRepository, mock());
new WaitTracker(mock(), executionRepository, mock(), mock());
expect(executionRepository.findSingleExecution).not.toHaveBeenCalled();
});
@@ -37,7 +37,7 @@ describe('WaitTracker', () => {
describe('if execution to start', () => {
it('if not enough time passed, should not start execution', async () => {
executionRepository.getWaitingExecutions.mockResolvedValue([execution]);
const waitTracker = new WaitTracker(mock(), executionRepository, mock());
const waitTracker = new WaitTracker(mock(), executionRepository, mock(), mock());
executionRepository.getWaitingExecutions.mockResolvedValue([execution]);
await waitTracker.getWaitingExecutions();
@@ -51,7 +51,7 @@ describe('WaitTracker', () => {
it('if enough time passed, should start execution', async () => {
executionRepository.getWaitingExecutions.mockResolvedValue([]);
const waitTracker = new WaitTracker(mock(), executionRepository, mock());
const waitTracker = new WaitTracker(mock(), executionRepository, mock(), mock());
executionRepository.getWaitingExecutions.mockResolvedValue([execution]);
await waitTracker.getWaitingExecutions();
@@ -68,7 +68,7 @@ describe('WaitTracker', () => {
describe('startExecution()', () => {
it('should query for execution to start', async () => {
executionRepository.getWaitingExecutions.mockResolvedValue([]);
const waitTracker = new WaitTracker(mock(), executionRepository, mock());
const waitTracker = new WaitTracker(mock(), executionRepository, mock(), mock());
executionRepository.findSingleExecution.mockResolvedValue(execution);
waitTracker.startExecution(execution.id);