(t *testing.T)
| 667 | } |
| 668 | |
| 669 | func TestGraphCommand_ErrorInvalidRoot(t *testing.T) { |
| 670 | tmpDir := createTestTaskFiles(t) |
| 671 | |
| 672 | // Reset flags |
| 673 | graphFormat = "json" |
| 674 | graphExcludeStatus = []string{} |
| 675 | graphRoot = "999" // Non-existent task |
| 676 | graphFocus = "" |
| 677 | graphUpstream = false |
| 678 | graphDownstream = false |
| 679 | graphOut = "" |
| 680 | |
| 681 | // Run command and expect error |
| 682 | err := runGraph(graphCmd, []string{tmpDir}) |
| 683 | if err == nil { |
| 684 | t.Fatal("Expected error for invalid root task") |
| 685 | } |
| 686 | |
| 687 | if !strings.Contains(err.Error(), "not found") { |
| 688 | t.Errorf("Expected 'not found' error, got: %v", err) |
| 689 | } |
| 690 | } |
| 691 | |
| 692 | func TestGraphCommand_ErrorInvalidFocus(t *testing.T) { |
| 693 | tmpDir := createTestTaskFiles(t) |
nothing calls this directly
no test coverage detected