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

Function TestGraphCommand_ErrorInvalidFocus

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

Source from the content-addressed store, hash-verified

690}
691
692func TestGraphCommand_ErrorInvalidFocus(t *testing.T) {
693 tmpDir := createTestTaskFiles(t)
694
695 // Reset flags
696 graphFormat = "json"
697 graphExcludeStatus = []string{}
698 graphRoot = ""
699 graphFocus = "999" // Non-existent task
700 graphUpstream = false
701 graphDownstream = false
702 graphOut = ""
703
704 // Run command and expect error
705 err := runGraph(graphCmd, []string{tmpDir})
706 if err == nil {
707 t.Fatal("Expected error for invalid focus task")
708 }
709
710 if !strings.Contains(err.Error(), "not found") {
711 t.Errorf("Expected 'not found' error, got: %v", err)
712 }
713}
714
715func TestGraphCommand_ErrorUpstreamDownstreamWithoutRoot(t *testing.T) {
716 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