fix(HAI-073): add blockedBy to updateTask parameter type

- Add blockedBy field to the updateTask parameter type in store.ts
- Add tests for updateTask blockedBy functionality
This commit is contained in:
Dustin Byrne
2026-03-26 00:21:57 -04:00
parent efda541713
commit 7b2248d6a4
2 changed files with 16 additions and 1 deletions

View File

@@ -385,4 +385,19 @@ describe("TaskStore", () => {
expect(updated.dependencies).toEqual(["HAI-001"]);
});
});
describe("updateTask — blockedBy", () => {
it("sets blockedBy to a string value", async () => {
const task = await store.createTask({ title: "Blocked task", description: "A task" });
const updated = await store.updateTask(task.id, { blockedBy: "HAI-999" });
expect(updated.blockedBy).toBe("HAI-999");
});
it("clears blockedBy when set to null", async () => {
const task = await store.createTask({ title: "Blocked task", description: "A task" });
await store.updateTask(task.id, { blockedBy: "HAI-999" });
const updated = await store.updateTask(task.id, { blockedBy: null });
expect(updated.blockedBy).toBeUndefined();
});
});
});

View File

@@ -282,7 +282,7 @@ export class TaskStore extends EventEmitter<TaskStoreEvents> {
async updateTask(
id: string,
updates: { title?: string; description?: string; prompt?: string; worktree?: string; status?: string | null; dependencies?: string[] },
updates: { title?: string; description?: string; prompt?: string; worktree?: string; status?: string | null; dependencies?: string[]; blockedBy?: string | null },
): Promise<Task> {
return this.withTaskLock(id, async () => {
const dir = this.taskDir(id);