Add tests for issue and PR project items query building

This commit is contained in:
William Martin 2023-11-01 17:40:29 +01:00
parent 83418cba54
commit 8a9eb7bfc2

View file

@ -33,6 +33,11 @@ func TestPullRequestGraphQL(t *testing.T) {
fields: []string{"isPinned", "stateReason", "number"},
want: "number",
},
{
name: "projectItems",
fields: []string{"projectItems"},
want: `projectItems(first:100){nodes{id, project{id,title}, status:fieldValueByName(name: "Status") { ... on ProjectV2ItemFieldSingleSelectValue{optionId,name}}},totalCount}`,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
@ -69,6 +74,11 @@ func TestIssueGraphQL(t *testing.T) {
fields: []string{"files"},
want: "files(first: 100) {nodes {additions,deletions,path}}",
},
{
name: "projectItems",
fields: []string{"projectItems"},
want: `projectItems(first:100){nodes{id, project{id,title}, status:fieldValueByName(name: "Status") { ... on ProjectV2ItemFieldSingleSelectValue{optionId,name}}},totalCount}`,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {