Skip to content

Commit

Permalink
Add tests for getting batches of executable tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
WMXPY committed Nov 4, 2023
1 parent de8ec95 commit 01560c6
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions test/e2e/one-to-many/execute-in-order.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,5 +99,48 @@ describe('Given (One-To-Many Execute In Order) Use Case', (): void => {
.forTaskWithProcedureIdentifier("THIRD")
.toBeExecutable();
});

it('Should be able to get fourth batch of executable tasks', (): void => {

applyActionOnTaskManager(
createPubAction(PUB_ACTION_TYPE.TASK_RESOLVE_SUCCEED, {
taskIdentifier: taskManager
.getTasksByProcedureIdentifier("SECOND")[0]
.taskIdentifier,
output: {},
}),
taskManager,
);

ExpectTaskManager.with(taskManager)
.hasExecutableTaskLength(2);

ExpectTaskManager.with(taskManager)
.forTaskWithProcedureIdentifier("END")
.toBeExecutable();
ExpectTaskManager.with(taskManager)
.forTaskWithProcedureIdentifier("THIRD")
.toBeExecutable();
});

it('Should be able to get fifth batch of executable tasks', (): void => {

applyActionOnTaskManager(
createPubAction(PUB_ACTION_TYPE.TASK_RESOLVE_SUCCEED, {
taskIdentifier: taskManager
.getTasksByProcedureIdentifier("THIRD")[0]
.taskIdentifier,
output: {},
}),
taskManager,
);

ExpectTaskManager.with(taskManager)
.hasExecutableTaskLength(1);

ExpectTaskManager.with(taskManager)
.forTaskWithProcedureIdentifier("END")
.toBeExecutable();
});
});
});

0 comments on commit 01560c6

Please sign in to comment.