MCPcopy Create free account
hub / github.com/cli/cli / TestIssueView_disabledIssues

Function TestIssueView_disabledIssues

pkg/cmd/issue/view/view_test.go:365–397  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

363}
364
365func TestIssueView_disabledIssues(t *testing.T) {
366 http := &httpmock.Registry{}
367 defer http.Verify(t)
368
369 http.Register(
370 httpmock.GraphQL(`query IssueByNumber\b`),
371 httpmock.StringResponse(`
372 {
373 "data":
374 { "repository": {
375 "id": "REPOID",
376 "hasIssuesEnabled": false
377 }
378 },
379 "errors": [
380 {
381 "type": "NOT_FOUND",
382 "path": [
383 "repository",
384 "issue"
385 ],
386 "message": "Could not resolve to an issue or pull request with the number of 6666."
387 }
388 ]
389 }
390 `),
391 )
392
393 _, err := runCommand(http, true, `6666`)
394 if err == nil || err.Error() != "the 'OWNER/REPO' repository has disabled issues" {
395 t.Errorf("error running command `issue view`: %v", err)
396 }
397}
398
399func TestIssueView_tty_Comments(t *testing.T) {
400 tests := map[string]struct {

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
ErrorMethod · 0.45

Tested by

no test coverage detected