MCPcopy
hub / github.com/cli/cli / TestIssueStatus_blankSlate

Function TestIssueStatus_blankSlate

pkg/cmd/issue/status/status_test.go:89–127  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

87}
88
89func TestIssueStatus_blankSlate(t *testing.T) {
90 http := &httpmock.Registry{}
91 defer http.Verify(t)
92
93 http.Register(
94 httpmock.GraphQL(`query UserCurrent\b`),
95 httpmock.StringResponse(`{"data":{"viewer":{"login":"octocat"}}}`))
96 http.Register(
97 httpmock.GraphQL(`query IssueStatus\b`),
98 httpmock.StringResponse(`
99 { "data": { "repository": {
100 "hasIssuesEnabled": true,
101 "assigned": { "nodes": [] },
102 "mentioned": { "nodes": [] },
103 "authored": { "nodes": [] }
104 } } }`))
105
106 output, err := runCommand(http, true, "")
107 if err != nil {
108 t.Errorf("error running command `issue status`: %v", err)
109 }
110
111 expectedOutput := `
112Relevant issues in OWNER/REPO
113
114Issues assigned to you
115 There are no issues assigned to you
116
117Issues mentioning you
118 There are no issues mentioning you
119
120Issues opened by you
121 There are no issues opened by you
122
123`
124 if output.String() != expectedOutput {
125 t.Errorf("expected %q, got %q", expectedOutput, output)
126 }
127}
128
129func TestIssueStatus_disabledIssues(t *testing.T) {
130 http := &httpmock.Registry{}

Callers

nothing calls this directly

Calls 7

VerifyMethod · 0.95
RegisterMethod · 0.95
GraphQLFunction · 0.92
StringResponseFunction · 0.92
runCommandFunction · 0.70
ErrorfMethod · 0.65
StringMethod · 0.45

Tested by

no test coverage detected