(t *testing.T)
| 280 | } |
| 281 | |
| 282 | func TestCmdListProjectsArchivedHidden(t *testing.T) { |
| 283 | root, db := showListEditDB(t) |
| 284 | insertProject(t, db, "live", "L", filepath.Join(root, "x"), "high") |
| 285 | insertProject(t, db, "gone", "G", filepath.Join(root, "y"), "low") |
| 286 | if _, err := db.Exec(`UPDATE projects SET archived_at = ? WHERE slug = ?`, flowdb.NowISO(), "gone"); err != nil { |
| 287 | t.Fatal(err) |
| 288 | } |
| 289 | out := captureStdout(t, func() { |
| 290 | if rc := cmdList([]string{"projects"}); rc != 0 { |
| 291 | t.Errorf("rc=%d", rc) |
| 292 | } |
| 293 | }) |
| 294 | if strings.Contains(out, "gone") { |
| 295 | t.Errorf("archived leaked; out=%q", out) |
| 296 | } |
| 297 | out2 := captureStdout(t, func() { |
| 298 | if rc := cmdList([]string{"projects", "--include-archived"}); rc != 0 { |
| 299 | t.Errorf("rc=%d", rc) |
| 300 | } |
| 301 | }) |
| 302 | if !strings.Contains(out2, "gone") { |
| 303 | t.Errorf("missing archived row; out=%q", out2) |
| 304 | } |
| 305 | if !strings.Contains(out2, "(archived)") { |
| 306 | t.Errorf("missing archived marker; out=%q", out2) |
| 307 | } |
| 308 | } |
| 309 | |
| 310 | func TestCmdListProjectsStatusFilter(t *testing.T) { |
| 311 | root, db := showListEditDB(t) |
nothing calls this directly
no test coverage detected