MCPcopy Create free account
hub / github.com/driangle/taskmd / TestGraphCommand_Mermaid_WithFocus

Function TestGraphCommand_Mermaid_WithFocus

apps/cli/internal/cli/graph_test.go:409–445  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

407}
408
409func TestGraphCommand_Mermaid_WithFocus(t *testing.T) {
410 tmpDir := createTestTaskFiles(t)
411
412 // Reset flags
413 graphFormat = "mermaid"
414 graphExcludeStatus = []string{}
415 graphRoot = ""
416 graphFocus = "003"
417 graphUpstream = false
418 graphDownstream = false
419 graphOut = ""
420
421 // Capture stdout
422 oldStdout := os.Stdout
423 r, w, _ := os.Pipe()
424 os.Stdout = w
425
426 // Run command
427 err := runGraph(graphCmd, []string{tmpDir})
428 if err != nil {
429 t.Fatalf("runGraph failed: %v", err)
430 }
431
432 // Restore stdout
433 w.Close()
434 os.Stdout = oldStdout
435
436 // Read output
437 var buf bytes.Buffer
438 buf.ReadFrom(r)
439 output := buf.String()
440
441 // Verify focus style is applied
442 if !strings.Contains(output, ":::focus") {
443 t.Error("Expected focused task to have :::focus style")
444 }
445}
446
447func TestGraphCommand_DOT_Format(t *testing.T) {
448 tmpDir := createTestTaskFiles(t)

Callers

nothing calls this directly

Calls 3

runGraphFunction · 0.85
ErrorMethod · 0.80
createTestTaskFilesFunction · 0.70

Tested by

no test coverage detected