@@ -94,7 +94,25 @@ describe("TaskList", () => {
9494 const { lastFrame } = render ( < TaskList /> ) ;
9595 const output = lastFrame ( ) ! ;
9696
97- expect ( output ) . toContain ( "4 tasks (2 done, 1 in progress, 2 open)" ) ;
97+ // "open" counts only pending tasks, not in_progress (no double-counting)
98+ expect ( output ) . toContain ( "4 tasks (2 done, 1 in progress, 1 open)" ) ;
99+ } ) ;
100+
101+ it ( "should not double-count in_progress in open count" , ( ) => {
102+ const mockTasks : Task [ ] = [
103+ makeTask ( { id : "1" , subject : "Task 1" , status : "in_progress" } ) ,
104+ makeTask ( { id : "2" , subject : "Task 2" , status : "in_progress" } ) ,
105+ makeTask ( { id : "3" , subject : "Task 3" , status : "pending" } ) ,
106+ makeTask ( { id : "4" , subject : "Task 4" , status : "completed" } ) ,
107+ ] ;
108+ vi . mocked ( useTasks ) . mockReturnValue ( mockTasks ) ;
109+
110+ const { lastFrame } = render ( < TaskList /> ) ;
111+ const output = lastFrame ( ) ! ;
112+
113+ // open = pending only (1), not pending + in_progress (3)
114+ expect ( output ) . toContain ( "4 tasks (1 done, 2 in progress, 1 open)" ) ;
115+ expect ( output ) . not . toContain ( "3 open" ) ;
98116 } ) ;
99117
100118 it ( "should truncate long task subjects with wrap=truncate-end" , ( ) => {
0 commit comments