MCPcopy
hub / github.com/cli/cli / TestIssueView_disabledIssues

Function TestIssueView_disabledIssues

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

Source from the content-addressed store, hash-verified

351}
352
353func TestIssueView_disabledIssues(t *testing.T) {
354 http := &httpmock.Registry{}
355 defer http.Verify(t)
356
357 http.Register(
358 httpmock.GraphQL(`query IssueByNumber\b`),
359 httpmock.StringResponse(`
360 {
361 "data":
362 { "repository": {
363 "id": "REPOID",
364 "hasIssuesEnabled": false
365 }
366 },
367 "errors": [
368 {
369 "type": "NOT_FOUND",
370 "path": [
371 "repository",
372 "issue"
373 ],
374 "message": "Could not resolve to an issue or pull request with the number of 6666."
375 }
376 ]
377 }
378 `),
379 )
380
381 _, err := runCommand(http, true, `6666`)
382 if err == nil || err.Error() != "the 'OWNER/REPO' repository has disabled issues" {
383 t.Errorf("error running command `issue view`: %v", err)
384 }
385}
386
387func TestIssueView_tty_Comments(t *testing.T) {
388 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