feat(FN-4592): complete Step 1 — clear userPaused on unpause
Fusion-Task-Id: FN-4592 Fusion-Task-Lineage: b013a15e-7cd9-4ba4-b380-22627cefb394
This commit is contained in:
@@ -449,6 +449,35 @@ describe("TaskStore", () => {
|
||||
const bounced = await store.getTask(task.id);
|
||||
expect(bounced.userPaused).toBeUndefined();
|
||||
});
|
||||
|
||||
it("clears userPaused when pauseTask(false) is called on a todo user-paused task", async () => {
|
||||
const task = await createTestTask();
|
||||
await store.moveTask(task.id, "todo");
|
||||
await store.updateTask(task.id, { userPaused: true });
|
||||
|
||||
const unpaused = await store.pauseTask(task.id, false);
|
||||
expect(unpaused.userPaused).toBeUndefined();
|
||||
expect(unpaused.paused).toBeUndefined();
|
||||
});
|
||||
|
||||
it("clears paused and userPaused when unpausing a paused todo task", async () => {
|
||||
const task = await createTestTask();
|
||||
await store.moveTask(task.id, "todo");
|
||||
await store.updateTask(task.id, { userPaused: true, paused: true });
|
||||
|
||||
const unpaused = await store.pauseTask(task.id, false);
|
||||
expect(unpaused.paused).toBeUndefined();
|
||||
expect(unpaused.userPaused).toBeUndefined();
|
||||
});
|
||||
|
||||
it("pauseTask(true) on todo does not set userPaused", async () => {
|
||||
const task = await createTestTask();
|
||||
await store.moveTask(task.id, "todo");
|
||||
|
||||
const paused = await store.pauseTask(task.id, true);
|
||||
expect(paused.paused).toBe(true);
|
||||
expect(paused.userPaused).toBeUndefined();
|
||||
});
|
||||
});
|
||||
|
||||
describe("execution timing timestamps", () => {
|
||||
|
||||
@@ -4511,6 +4511,7 @@ export class TaskStore extends EventEmitter<TaskStoreEvents> {
|
||||
}
|
||||
if (!paused) {
|
||||
task.pausedByAgentId = undefined;
|
||||
task.userPaused = undefined;
|
||||
}
|
||||
// When pausing an in-progress/in-review task, set status so the UI can show the state.
|
||||
// When unpausing, clear the "paused" status.
|
||||
|
||||
Reference in New Issue
Block a user