(t *testing.T)
| 348 | } |
| 349 | |
| 350 | func TestRunDelete_JSON(t *testing.T) { |
| 351 | defer gock.Off() |
| 352 | gock.Observe(gock.DumpRequest) |
| 353 | |
| 354 | // get user ID |
| 355 | gock.New("https://api.github.com"). |
| 356 | Post("/graphql"). |
| 357 | MatchType("json"). |
| 358 | JSON(map[string]interface{}{ |
| 359 | "query": "query UserOrgOwner.*", |
| 360 | "variables": map[string]interface{}{ |
| 361 | "login": "monalisa", |
| 362 | }, |
| 363 | }). |
| 364 | Reply(200). |
| 365 | JSON(map[string]interface{}{ |
| 366 | "data": map[string]interface{}{ |
| 367 | "user": map[string]interface{}{ |
| 368 | "id": "an ID", |
| 369 | }, |
| 370 | }, |
| 371 | "errors": []interface{}{ |
| 372 | map[string]interface{}{ |
| 373 | "type": "NOT_FOUND", |
| 374 | "path": []string{"organization"}, |
| 375 | }, |
| 376 | }, |
| 377 | }) |
| 378 | |
| 379 | // get project ID |
| 380 | gock.New("https://api.github.com"). |
| 381 | Post("/graphql"). |
| 382 | MatchType("json"). |
| 383 | JSON(map[string]interface{}{ |
| 384 | "query": "query UserProject.*", |
| 385 | "variables": map[string]interface{}{ |
| 386 | "login": "monalisa", |
| 387 | "number": 1, |
| 388 | "firstItems": 0, |
| 389 | "afterItems": nil, |
| 390 | "firstFields": 0, |
| 391 | "afterFields": nil, |
| 392 | }, |
| 393 | }). |
| 394 | Reply(200). |
| 395 | JSON(map[string]interface{}{ |
| 396 | "data": map[string]interface{}{ |
| 397 | "user": map[string]interface{}{ |
| 398 | "projectV2": map[string]interface{}{ |
| 399 | "id": "an ID", |
| 400 | }, |
| 401 | }, |
| 402 | }, |
| 403 | }) |
| 404 | |
| 405 | // delete project |
| 406 | gock.New("https://api.github.com"). |
| 407 | Post("/graphql"). |
nothing calls this directly
no test coverage detected