@@ -106,6 +106,48 @@ describe("registerWorkboardCli", () => {
106106 expect ( showOutput ) . toContain ( "[redacted]" ) ;
107107 } ) ;
108108
109+ it ( "hides archived cards from list output by default" , async ( ) => {
110+ const store = new WorkboardStore ( createMemoryStore ( ) ) ;
111+ await store . create ( { title : "Active card" } ) ;
112+ const archived = await store . create ( { title : "Archived card" } ) ;
113+ await store . archive ( archived . id , true ) ;
114+ const program = createProgram ( store ) ;
115+
116+ const textOutput = await captureStdout ( async ( ) => {
117+ await program . parseAsync ( [ "workboard" , "list" ] , { from : "user" } ) ;
118+ } ) ;
119+ const jsonOutput = await captureStdout ( async ( ) => {
120+ await program . parseAsync ( [ "workboard" , "list" , "--json" ] , { from : "user" } ) ;
121+ } ) ;
122+
123+ expect ( textOutput ) . toContain ( "Active card" ) ;
124+ expect ( textOutput ) . not . toContain ( "Archived card" ) ;
125+ expect ( jsonOutput ) . toContain ( "Active card" ) ;
126+ expect ( jsonOutput ) . not . toContain ( "Archived card" ) ;
127+ } ) ;
128+
129+ it ( "includes archived cards when list uses include-archived" , async ( ) => {
130+ const store = new WorkboardStore ( createMemoryStore ( ) ) ;
131+ await store . create ( { title : "Active card" } ) ;
132+ const archived = await store . create ( { title : "Archived card" } ) ;
133+ await store . archive ( archived . id , true ) ;
134+ const program = createProgram ( store ) ;
135+
136+ const textOutput = await captureStdout ( async ( ) => {
137+ await program . parseAsync ( [ "workboard" , "list" , "--include-archived" ] , { from : "user" } ) ;
138+ } ) ;
139+ const jsonOutput = await captureStdout ( async ( ) => {
140+ await program . parseAsync ( [ "workboard" , "list" , "--include-archived" , "--json" ] , {
141+ from : "user" ,
142+ } ) ;
143+ } ) ;
144+
145+ expect ( textOutput ) . toContain ( "Active card" ) ;
146+ expect ( textOutput ) . toContain ( "Archived card" ) ;
147+ expect ( jsonOutput ) . toContain ( "Active card" ) ;
148+ expect ( jsonOutput ) . toContain ( "Archived card" ) ;
149+ } ) ;
150+
109151 it ( "does not fall back to local dispatch for explicit gateway targets" , async ( ) => {
110152 const store = new WorkboardStore ( createMemoryStore ( ) ) ;
111153 const card = await store . create ( { title : "Remote target" , status : "ready" } ) ;
0 commit comments