@@ -106,26 +106,38 @@ describe("registerWorkboardCli", () => {
106106 expect ( showOutput ) . toContain ( "[redacted]" ) ;
107107 } ) ;
108108
109- it ( "hides archived cards by default and reveals them with --include-archived" , async ( ) => {
109+ it ( "hides archived cards from text output by default and reveals them with --include-archived" , async ( ) => {
110110 const store = new WorkboardStore ( createMemoryStore ( ) ) ;
111- const active = await store . create ( { title : "Active card" } ) ;
111+ await store . create ( { title : "Active card" } ) ;
112112 const archived = await store . create ( { title : "Archived card" } ) ;
113113 await store . archive ( archived . id , true ) ;
114114 const program = createProgram ( store ) ;
115115
116116 const defaultOutput = await captureStdout ( async ( ) => {
117- await program . parseAsync ( [ "workboard" , "list" , "--json" ] , { from : "user" } ) ;
117+ await program . parseAsync ( [ "workboard" , "list" ] , { from : "user" } ) ;
118118 } ) ;
119119 const includeOutput = await captureStdout ( async ( ) => {
120- await program . parseAsync ( [ "workboard" , "list" , "--include-archived" , "--json" ] , {
121- from : "user" ,
122- } ) ;
120+ await program . parseAsync ( [ "workboard" , "list" , "--include-archived" ] , { from : "user" } ) ;
121+ } ) ;
122+
123+ expect ( defaultOutput ) . toContain ( "Active card" ) ;
124+ expect ( defaultOutput ) . not . toContain ( "Archived card" ) ;
125+ expect ( includeOutput ) . toContain ( "Active card" ) ;
126+ expect ( includeOutput ) . toContain ( "Archived card" ) ;
127+ } ) ;
128+
129+ it ( "preserves archived cards in JSON list output by default" , async ( ) => {
130+ const store = new WorkboardStore ( createMemoryStore ( ) ) ;
131+ const archived = await store . create ( { title : "Archived card" } ) ;
132+ await store . archive ( archived . id , true ) ;
133+ const program = createProgram ( store ) ;
134+
135+ const output = await captureStdout ( async ( ) => {
136+ await program . parseAsync ( [ "workboard" , "list" , "--json" ] , { from : "user" } ) ;
123137 } ) ;
124138
125- expect ( defaultOutput ) . toContain ( active . id ) ;
126- expect ( defaultOutput ) . not . toContain ( archived . id ) ;
127- expect ( includeOutput ) . toContain ( active . id ) ;
128- expect ( includeOutput ) . toContain ( archived . id ) ;
139+ expect ( output ) . toContain ( archived . id ) ;
140+ expect ( output ) . toContain ( "archivedAt" ) ;
129141 } ) ;
130142
131143 it ( "does not fall back to local dispatch for explicit gateway targets" , async ( ) => {
0 commit comments