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:
@@ -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();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user