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

Function TestCmdShowProjectHappyPath

internal/app/show_test.go:334–354  ·  view source on GitHub ↗

---------- project path ----------

(t *testing.T)

Source from the content-addressed store, hash-verified

332// ---------- project path ----------
333
334func TestCmdShowProjectHappyPath(t *testing.T) {
335 root, db := showListEditDB(t)
336 insertProject(t, db, "biglift", "Big Lift", filepath.Join(root, "repo"), "high")
337 insertTask(t, db, "bl-one", "One", "in-progress", "medium", filepath.Join(root, "repo"), "biglift")
338 insertTask(t, db, "bl-two", "Two", "backlog", "low", filepath.Join(root, "repo"), "biglift")
339 insertTask(t, db, "bl-three", "Three", "done", "low", filepath.Join(root, "repo"), "biglift")
340 out := captureStdout(t, func() {
341 if rc := cmdShow([]string{"project", "biglift"}); rc != 0 {
342 t.Errorf("rc=%d", rc)
343 }
344 })
345 if !strings.Contains(out, "slug: biglift") {
346 t.Errorf("missing slug; out=%q", out)
347 }
348 if !strings.Contains(out, "3 total") {
349 t.Errorf("missing total count; out=%q", out)
350 }
351 if !strings.Contains(out, "1 in-progress, 1 backlog, 1 done") {
352 t.Errorf("missing breakdown; out=%q", out)
353 }
354}
355
356func TestCmdShowProjectDefaultsFromEnv(t *testing.T) {
357 root, db := showListEditDB(t)

Callers

nothing calls this directly

Calls 5

showListEditDBFunction · 0.85
captureStdoutFunction · 0.85
cmdShowFunction · 0.85
insertProjectFunction · 0.70
insertTaskFunction · 0.70

Tested by

no test coverage detected