(t *testing.T)
| 407 | } |
| 408 | |
| 409 | func 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 | |
| 447 | func TestGraphCommand_DOT_Format(t *testing.T) { |
| 448 | tmpDir := createTestTaskFiles(t) |
nothing calls this directly
no test coverage detected