(t *testing.T)
| 87 | } |
| 88 | |
| 89 | func 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 := ` |
| 112 | Relevant issues in OWNER/REPO |
| 113 | |
| 114 | Issues assigned to you |
| 115 | There are no issues assigned to you |
| 116 | |
| 117 | Issues mentioning you |
| 118 | There are no issues mentioning you |
| 119 | |
| 120 | Issues 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 | |
| 129 | func TestIssueStatus_disabledIssues(t *testing.T) { |
| 130 | http := &httpmock.Registry{} |
nothing calls this directly
no test coverage detected