This commit is contained in:
2025-11-30 23:00:48 +01:00
parent 4b8c70978f
commit 645f537895
41 changed files with 738 additions and 1631 deletions

View File

@@ -43,7 +43,7 @@ describe('Workflow hosted session end-to-end (fixture-backed)', () => {
return { repository, engine, useCase };
}
it('runs 118 from use case to STOPPED_AT_STEP_18', async () => {
it('runs 117 from use case and stops automation at manual Track Conditions (STOPPED_AT_STEP_18)', async () => {
const { repository, engine, useCase } = createFixtureEngine();
const config: any = {
@@ -64,13 +64,13 @@ describe('Workflow hosted session end-to-end (fixture-backed)', () => {
// Poll repository until automation loop completes
// MockAutomationEngineAdapter drives the step orchestrator internally.
// Session should end in STOPPED_AT_STEP_18 when step 18 completes.
// Session should end in STOPPED_AT_STEP_18 after completing automated step 17.
// eslint-disable-next-line no-constant-condition
while (true) {
const sessions = await repository.findAll();
finalSession = sessions[0] ?? null;
if (finalSession && (finalSession.state.isStoppedAtStep18() || finalSession.state.isFailed())) {
if (finalSession && finalSession.state.isStoppedAtStep18()) {
break;
}
@@ -83,7 +83,7 @@ describe('Workflow hosted session end-to-end (fixture-backed)', () => {
expect(finalSession).not.toBeNull();
expect(finalSession!.state.isStoppedAtStep18()).toBe(true);
expect(finalSession!.currentStep.value).toBe(18);
expect(finalSession!.currentStep.value).toBe(17);
expect(finalSession!.startedAt).toBeInstanceOf(Date);
expect(finalSession!.completedAt).toBeInstanceOf(Date);
expect(finalSession!.errorMessage).toBeUndefined();
@@ -129,7 +129,7 @@ describe('Workflow hosted session end-to-end (fixture-backed)', () => {
const sessions = await repository.findAll();
finalSession = sessions[0] ?? null;
if (finalSession && (finalSession.state.isFailed() || finalSession.state.isStoppedAtStep18())) {
if (finalSession && finalSession.state.isFailed()) {
break;
}
@@ -143,11 +143,7 @@ describe('Workflow hosted session end-to-end (fixture-backed)', () => {
await failingAdapter.disconnect();
expect(finalSession).not.toBeNull();
expect(
finalSession!.state.isFailed() || finalSession!.state.isStoppedAtStep18(),
).toBe(true);
if (finalSession!.state.isFailed()) {
expect(finalSession!.errorMessage).toBeDefined();
}
expect(finalSession!.state.isFailed()).toBe(true);
expect(finalSession!.errorMessage).toBeDefined();
});
});