MCPcopy
hub / github.com/cli/cli / TestIssueList_tty_withFlags

Function TestIssueList_tty_withFlags

pkg/cmd/issue/list/list_test.go:167–189  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

165}
166
167func TestIssueList_tty_withFlags(t *testing.T) {
168 http := &httpmock.Registry{}
169 defer http.Verify(t)
170
171 http.Register(
172 httpmock.GraphQL(`query IssueList\b`),
173 httpmock.GraphQLQuery(`
174 { "data": { "repository": {
175 "hasIssuesEnabled": true,
176 "issues": { "nodes": [] }
177 } } }`, func(_ string, params map[string]interface{}) {
178 assert.Equal(t, "probablyCher", params["assignee"].(string))
179 assert.Equal(t, "foo", params["author"].(string))
180 assert.Equal(t, "me", params["mention"].(string))
181 assert.Equal(t, []interface{}{"OPEN"}, params["states"].([]interface{}))
182 }))
183
184 output, err := runCommand(http, true, "-a probablyCher -s open -A foo --mention me")
185 assert.EqualError(t, err, "no issues match your search in OWNER/REPO")
186
187 assert.Equal(t, "", output.String())
188 assert.Equal(t, "", output.Stderr())
189}
190
191func TestIssueList_tty_withAppFlag(t *testing.T) {
192 http := &httpmock.Registry{}

Callers

nothing calls this directly

Calls 8

VerifyMethod · 0.95
RegisterMethod · 0.95
GraphQLFunction · 0.92
GraphQLQueryFunction · 0.92
EqualMethod · 0.80
StderrMethod · 0.80
runCommandFunction · 0.70
StringMethod · 0.45

Tested by

no test coverage detected