@@ -106,6 +106,40 @@ describe("registerWorkboardCli", () => {
|
106 | 106 | expect(showOutput).toContain("[redacted]"); |
107 | 107 | }); |
108 | 108 | |
| 109 | +it("hides archived cards from text output by default and reveals them with --include-archived", 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 defaultOutput = await captureStdout(async () => { |
| 117 | +await program.parseAsync(["workboard", "list"], { from: "user" }); |
| 118 | +}); |
| 119 | +const includeOutput = await captureStdout(async () => { |
| 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" }); |
| 137 | +}); |
| 138 | + |
| 139 | +expect(output).toContain(archived.id); |
| 140 | +expect(output).toContain("archivedAt"); |
| 141 | +}); |
| 142 | + |
109 | 143 | it("does not fall back to local dispatch for explicit gateway targets", async () => { |
110 | 144 | const store = new WorkboardStore(createMemoryStore()); |
111 | 145 | const card = await store.create({ title: "Remote target", status: "ready" }); |
|