wip
This commit is contained in:
@@ -43,7 +43,7 @@ describe('Workflow – hosted session end-to-end (fixture-backed)', () => {
|
||||
return { repository, engine, useCase };
|
||||
}
|
||||
|
||||
it('runs 1–18 from use case to STOPPED_AT_STEP_18', async () => {
|
||||
it('runs 1–17 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();
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user