test(coding-agent): flushed coalesced observer sync before todo assertion
- Subagent lifecycle reconciliation now runs behind the 100ms observer UI coalescing timer; the test advances fake timers instead of asserting synchronously after emit.
This commit is contained in:
@@ -134,6 +134,9 @@ describe("InteractiveMode todo HUD persistence", () => {
|
||||
mode.setTodos(session.getTodoPhases());
|
||||
|
||||
await mode.init();
|
||||
// Subagent lifecycle changes coalesce behind a 100ms observer UI sync
|
||||
// timer before todo reconciliation runs; flush it deterministically.
|
||||
vi.useFakeTimers();
|
||||
eventBus.emit(TASK_SUBAGENT_LIFECYCLE_CHANNEL, {
|
||||
id: "ReviewFixer",
|
||||
index: 0,
|
||||
@@ -142,6 +145,7 @@ describe("InteractiveMode todo HUD persistence", () => {
|
||||
status: "completed",
|
||||
detached: true,
|
||||
});
|
||||
vi.advanceTimersByTime(100);
|
||||
|
||||
expect(session.getTodoPhases()[0]?.tasks[0]?.status).toBe("completed");
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user