(t *testing.T)
| 120 | } |
| 121 | |
| 122 | func TestIssueReopen_issuesDisabled(t *testing.T) { |
| 123 | http := &httpmock.Registry{} |
| 124 | defer http.Verify(t) |
| 125 | |
| 126 | http.Register( |
| 127 | httpmock.GraphQL(`query IssueByNumber\b`), |
| 128 | httpmock.StringResponse(` |
| 129 | { |
| 130 | "data": { |
| 131 | "repository": { |
| 132 | "hasIssuesEnabled": false, |
| 133 | "issue": null |
| 134 | } |
| 135 | }, |
| 136 | "errors": [ |
| 137 | { |
| 138 | "type": "NOT_FOUND", |
| 139 | "path": [ |
| 140 | "repository", |
| 141 | "issue" |
| 142 | ], |
| 143 | "message": "Could not resolve to an issue or pull request with the number of 2." |
| 144 | } |
| 145 | ] |
| 146 | }`), |
| 147 | ) |
| 148 | |
| 149 | _, err := runCommand(http, true, "2") |
| 150 | if err == nil || err.Error() != "the 'OWNER/REPO' repository has disabled issues" { |
| 151 | t.Fatalf("got error: %v", err) |
| 152 | } |
| 153 | } |
| 154 | |
| 155 | func TestIssueReopen_withComment(t *testing.T) { |
| 156 | http := &httpmock.Registry{} |
nothing calls this directly
no test coverage detected