(t *testing.T)
| 682 | } |
| 683 | |
| 684 | func TestFieldValueNodesDisplayValue(t *testing.T) { |
| 685 | textValue := func(text string) FieldValueNodes { |
| 686 | v := FieldValueNodes{Type: "ProjectV2ItemFieldTextValue"} |
| 687 | v.ProjectV2ItemFieldTextValue.Text = text |
| 688 | return v |
| 689 | } |
| 690 | |
| 691 | numberValue := FieldValueNodes{Type: "ProjectV2ItemFieldNumberValue"} |
| 692 | numberValue.ProjectV2ItemFieldNumberValue.Number = 12 |
| 693 | |
| 694 | singleSelectValue := FieldValueNodes{Type: "ProjectV2ItemFieldSingleSelectValue"} |
| 695 | singleSelectValue.ProjectV2ItemFieldSingleSelectValue.Name = "In Progress" |
| 696 | |
| 697 | labelValue := FieldValueNodes{Type: "ProjectV2ItemFieldLabelValue"} |
| 698 | labelValue.ProjectV2ItemFieldLabelValue.Labels.Nodes = []struct { |
| 699 | Name string |
| 700 | }{ |
| 701 | {Name: "bug"}, |
| 702 | {Name: "help wanted"}, |
| 703 | } |
| 704 | |
| 705 | dateValue := FieldValueNodes{Type: "ProjectV2ItemFieldDateValue"} |
| 706 | dateValue.ProjectV2ItemFieldDateValue.Date = "2022-05-01" |
| 707 | |
| 708 | iterationValue := FieldValueNodes{Type: "ProjectV2ItemFieldIterationValue"} |
| 709 | iterationValue.ProjectV2ItemFieldIterationValue.Title = "Sprint 1" |
| 710 | |
| 711 | milestoneValue := FieldValueNodes{Type: "ProjectV2ItemFieldMilestoneValue"} |
| 712 | milestoneValue.ProjectV2ItemFieldMilestoneValue.Milestone.Title = "v1.0" |
| 713 | |
| 714 | pullRequestValue := FieldValueNodes{Type: "ProjectV2ItemFieldPullRequestValue"} |
| 715 | pullRequestValue.ProjectV2ItemFieldPullRequestValue.PullRequests.Nodes = []struct { |
| 716 | Url string |
| 717 | }{ |
| 718 | {Url: "https://github.com/cli/cli/pull/1"}, |
| 719 | {Url: "https://github.com/cli/cli/pull/2"}, |
| 720 | } |
| 721 | |
| 722 | repositoryValue := FieldValueNodes{Type: "ProjectV2ItemFieldRepositoryValue"} |
| 723 | repositoryValue.ProjectV2ItemFieldRepositoryValue.Repository.Url = "https://github.com/cli/cli" |
| 724 | |
| 725 | userValue := FieldValueNodes{Type: "ProjectV2ItemFieldUserValue"} |
| 726 | userValue.ProjectV2ItemFieldUserValue.Users.Nodes = []struct { |
| 727 | Login string |
| 728 | }{ |
| 729 | {Login: "monalisa"}, |
| 730 | {Login: "hubot"}, |
| 731 | } |
| 732 | |
| 733 | reviewerValue := FieldValueNodes{Type: "ProjectV2ItemFieldReviewerValue"} |
| 734 | reviewerValue.ProjectV2ItemFieldReviewerValue.Reviewers.Nodes = []struct { |
| 735 | Type string `graphql:"__typename"` |
| 736 | Team struct { |
| 737 | Name string |
| 738 | } `graphql:"... on Team"` |
| 739 | User struct { |
| 740 | Login string |
| 741 | } `graphql:"... on User"` |
nothing calls this directly
no test coverage detected