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

Function TestGraphCommand_ErrorInvalidRoot

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

Source from the content-addressed store, hash-verified

667}
668
669func 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
692func TestGraphCommand_ErrorInvalidFocus(t *testing.T) {
693 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