fix(tasktree): complete tasks when reports are written
This commit is contained in:
@@ -166,11 +166,20 @@ test("native PostgreSQL store exposes overview and three task levels", async ()
|
||||
(error: any) => error?.code === "execution_report_required"
|
||||
);
|
||||
const firstReport = await store.writeReport({ taskId: task.id, title: "Execution", body: "passed" });
|
||||
assert.equal(firstReport.task.status, "completed");
|
||||
assert.equal(firstReport.taskMutation, true);
|
||||
const repeatedReport = await store.writeReport({ taskId: task.id, title: "Execution", body: "passed" });
|
||||
assert.equal(repeatedReport.taskMutation, false);
|
||||
await store.updateTask(task.id, { status: "blocked" });
|
||||
const correctedReport = await store.writeReport({ taskId: task.id, title: "Execution", body: "passed" });
|
||||
assert.equal(correctedReport.mutation, false);
|
||||
assert.equal(correctedReport.taskMutation, true);
|
||||
assert.equal(correctedReport.task.status, "completed");
|
||||
const changedReport = await store.writeReport({ taskId: task.id, title: "Execution", body: "passed with evidence" });
|
||||
assert.equal(firstReport.mutation, true);
|
||||
assert.equal(repeatedReport.mutation, false);
|
||||
assert.equal(changedReport.mutation, true);
|
||||
assert.equal(changedReport.taskMutation, false);
|
||||
assert.equal(firstReport.report.id, repeatedReport.report.id);
|
||||
assert.equal(firstReport.report.id, changedReport.report.id);
|
||||
assert.equal((await store.completeTask(task.id))?.status, "completed");
|
||||
|
||||
Reference in New Issue
Block a user