MCPcopy Create free account
hub / github.com/Facets-cloud/flow / TestCmdListProjectsArchivedHidden

Function TestCmdListProjectsArchivedHidden

internal/app/list_test.go:282–308  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

280}
281
282func 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
310func TestCmdListProjectsStatusFilter(t *testing.T) {
311 root, db := showListEditDB(t)

Callers

nothing calls this directly

Calls 5

NowISOFunction · 0.92
showListEditDBFunction · 0.85
captureStdoutFunction · 0.85
cmdListFunction · 0.85
insertProjectFunction · 0.70

Tested by

no test coverage detected