(t *testing.T)
| 204 | } |
| 205 | |
| 206 | func Test_RepoMetadata(t *testing.T) { |
| 207 | http := &httpmock.Registry{} |
| 208 | client := newTestClient(http) |
| 209 | |
| 210 | repo, _ := ghrepo.FromFullName("OWNER/REPO") |
| 211 | input := RepoMetadataInput{ |
| 212 | Assignees: true, |
| 213 | Reviewers: true, |
| 214 | TeamReviewers: true, |
| 215 | Labels: true, |
| 216 | ProjectsV1: true, |
| 217 | ProjectsV2: true, |
| 218 | Milestones: true, |
| 219 | } |
| 220 | |
| 221 | http.Register( |
| 222 | httpmock.GraphQL(`query RepositoryAssignableUsers\b`), |
| 223 | httpmock.StringResponse(` |
| 224 | { "data": { "repository": { "assignableUsers": { |
| 225 | "nodes": [ |
| 226 | { "login": "hubot", "id": "HUBOTID" }, |
| 227 | { "login": "MonaLisa", "id": "MONAID" } |
| 228 | ], |
| 229 | "pageInfo": { "hasNextPage": false } |
| 230 | } } } } |
| 231 | `)) |
| 232 | http.Register( |
| 233 | httpmock.GraphQL(`query RepositoryLabelList\b`), |
| 234 | httpmock.StringResponse(` |
| 235 | { "data": { "repository": { "labels": { |
| 236 | "nodes": [ |
| 237 | { "name": "feature", "id": "FEATUREID" }, |
| 238 | { "name": "TODO", "id": "TODOID" }, |
| 239 | { "name": "bug", "id": "BUGID" } |
| 240 | ], |
| 241 | "pageInfo": { "hasNextPage": false } |
| 242 | } } } } |
| 243 | `)) |
| 244 | http.Register( |
| 245 | httpmock.GraphQL(`query RepositoryMilestoneList\b`), |
| 246 | httpmock.StringResponse(` |
| 247 | { "data": { "repository": { "milestones": { |
| 248 | "nodes": [ |
| 249 | { "title": "GA", "id": "GAID" }, |
| 250 | { "title": "Big One.oh", "id": "BIGONEID" } |
| 251 | ], |
| 252 | "pageInfo": { "hasNextPage": false } |
| 253 | } } } } |
| 254 | `)) |
| 255 | http.Register( |
| 256 | httpmock.GraphQL(`query RepositoryProjectList\b`), |
| 257 | httpmock.StringResponse(` |
| 258 | { "data": { "repository": { "projects": { |
| 259 | "nodes": [ |
| 260 | { "name": "Cleanup", "id": "CLEANUPID" }, |
| 261 | { "name": "Roadmap", "id": "ROADMAPID" } |
| 262 | ], |
| 263 | "pageInfo": { "hasNextPage": false } |
nothing calls this directly
no test coverage detected