(t *testing.T)
| 294 | } |
| 295 | |
| 296 | func TestRunUnlink_Team(t *testing.T) { |
| 297 | defer gock.Off() |
| 298 | gock.Observe(gock.DumpRequest) |
| 299 | |
| 300 | // get user ID |
| 301 | gock.New("https://api.github.com"). |
| 302 | Post("/graphql"). |
| 303 | MatchType("json"). |
| 304 | JSON(map[string]interface{}{ |
| 305 | "query": "query UserOrgOwner.*", |
| 306 | "variables": map[string]string{ |
| 307 | "login": "monalisa-org", |
| 308 | }, |
| 309 | }). |
| 310 | Reply(200). |
| 311 | JSON(map[string]interface{}{ |
| 312 | "data": map[string]interface{}{ |
| 313 | "user": map[string]interface{}{ |
| 314 | "id": "an ID", |
| 315 | "login": "monalisa-org", |
| 316 | }, |
| 317 | }, |
| 318 | "errors": []interface{}{ |
| 319 | map[string]interface{}{ |
| 320 | "type": "NOT_FOUND", |
| 321 | "path": []string{"organization"}, |
| 322 | }, |
| 323 | }, |
| 324 | }) |
| 325 | |
| 326 | // get user project ID |
| 327 | gock.New("https://api.github.com"). |
| 328 | Post("/graphql"). |
| 329 | MatchType("json"). |
| 330 | JSON(map[string]interface{}{ |
| 331 | "query": "query UserProject.*", |
| 332 | "variables": map[string]interface{}{ |
| 333 | "login": "monalisa-org", |
| 334 | "number": 1, |
| 335 | "firstItems": 0, |
| 336 | "afterItems": nil, |
| 337 | "firstFields": 0, |
| 338 | "afterFields": nil, |
| 339 | }, |
| 340 | }). |
| 341 | Reply(200). |
| 342 | JSON(map[string]interface{}{ |
| 343 | "data": map[string]interface{}{ |
| 344 | "user": map[string]interface{}{ |
| 345 | "projectV2": map[string]string{ |
| 346 | "id": "project-ID", |
| 347 | "title": "first-project", |
| 348 | }, |
| 349 | }, |
| 350 | }, |
| 351 | }) |
| 352 | |
| 353 | // unlink projectV2 from team |
nothing calls this directly
no test coverage detected