(t *testing.T)
| 639 | } |
| 640 | |
| 641 | func TestRunItemEdit_SingleSelect(t *testing.T) { |
| 642 | defer gock.Off() |
| 643 | // gock.Observe(gock.DumpRequest) |
| 644 | |
| 645 | // edit item |
| 646 | gock.New("https://api.github.com"). |
| 647 | Post("/graphql"). |
| 648 | BodyString(`{"query":"mutation UpdateItemValues.*","variables":{"input":{"projectId":"project_id","itemId":"item_id","fieldId":"field_id","value":{"singleSelectOptionId":"option_id"}}}}`). |
| 649 | Reply(200). |
| 650 | JSON(map[string]any{ |
| 651 | "data": map[string]any{ |
| 652 | "updateProjectV2ItemFieldValue": map[string]any{ |
| 653 | "projectV2Item": map[string]any{ |
| 654 | "ID": "item_id", |
| 655 | "content": map[string]any{ |
| 656 | "__typename": "Issue", |
| 657 | "body": "body", |
| 658 | "title": "title", |
| 659 | "number": 1, |
| 660 | "repository": map[string]any{ |
| 661 | "nameWithOwner": "my-repo", |
| 662 | }, |
| 663 | }, |
| 664 | }, |
| 665 | }, |
| 666 | }, |
| 667 | }) |
| 668 | |
| 669 | client := queries.NewTestClient() |
| 670 | |
| 671 | ios, _, stdout, _ := iostreams.Test() |
| 672 | config := editItemConfig{ |
| 673 | io: ios, |
| 674 | opts: editItemOpts{ |
| 675 | singleSelectOptionID: "option_id", |
| 676 | itemID: "item_id", |
| 677 | projectID: "project_id", |
| 678 | fieldID: "field_id", |
| 679 | }, |
| 680 | client: client, |
| 681 | } |
| 682 | |
| 683 | err := runEditItem(config) |
| 684 | assert.NoError(t, err) |
| 685 | assert.Equal(t, "", stdout.String()) |
| 686 | } |
| 687 | |
| 688 | func TestRunItemEdit_Iteration(t *testing.T) { |
| 689 | defer gock.Off() |
nothing calls this directly
no test coverage detected