(t *testing.T)
| 416 | } |
| 417 | |
| 418 | func TestRunUpdate_OmitParams(t *testing.T) { |
| 419 | defer gock.Off() |
| 420 | gock.Observe(gock.DumpRequest) |
| 421 | // get user ID |
| 422 | gock.New("https://api.github.com"). |
| 423 | Post("/graphql"). |
| 424 | MatchType("json"). |
| 425 | JSON(map[string]interface{}{ |
| 426 | "query": "query UserOrgOwner.*", |
| 427 | "variables": map[string]interface{}{ |
| 428 | "login": "monalisa", |
| 429 | }, |
| 430 | }). |
| 431 | Reply(200). |
| 432 | JSON(map[string]interface{}{ |
| 433 | "data": map[string]interface{}{ |
| 434 | "user": map[string]interface{}{ |
| 435 | "id": "an ID", |
| 436 | }, |
| 437 | }, |
| 438 | "errors": []interface{}{ |
| 439 | map[string]interface{}{ |
| 440 | "type": "NOT_FOUND", |
| 441 | "path": []string{"organization"}, |
| 442 | }, |
| 443 | }, |
| 444 | }) |
| 445 | |
| 446 | // get user project ID |
| 447 | gock.New("https://api.github.com"). |
| 448 | Post("/graphql"). |
| 449 | MatchType("json"). |
| 450 | JSON(map[string]interface{}{ |
| 451 | "query": "query UserProject.*", |
| 452 | "variables": map[string]interface{}{ |
| 453 | "login": "monalisa", |
| 454 | "number": 1, |
| 455 | "firstItems": 0, |
| 456 | "afterItems": nil, |
| 457 | "firstFields": 0, |
| 458 | "afterFields": nil, |
| 459 | }, |
| 460 | }). |
| 461 | Reply(200). |
| 462 | JSON(map[string]interface{}{ |
| 463 | "data": map[string]interface{}{ |
| 464 | "user": map[string]interface{}{ |
| 465 | "projectV2": map[string]string{ |
| 466 | "id": "an ID", |
| 467 | }, |
| 468 | }, |
| 469 | }, |
| 470 | }) |
| 471 | |
| 472 | // Update project |
| 473 | gock.New("https://api.github.com"). |
| 474 | Post("/graphql"). |
| 475 | BodyString(`{"query":"mutation UpdateProjectV2.*"variables":{"afterFields":null,"afterItems":null,"firstFields":0,"firstItems":0,"input":{"projectId":"an ID","title":"another title"}}}`). |
nothing calls this directly
no test coverage detected