From 8a9eb7bfc265d7ac79f9b742f44fd2e52d62647e Mon Sep 17 00:00:00 2001 From: William Martin Date: Wed, 1 Nov 2023 17:40:29 +0100 Subject: [PATCH] Add tests for issue and PR project items query building --- api/query_builder_test.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/api/query_builder_test.go b/api/query_builder_test.go index 7048b63fb..e39b08269 100644 --- a/api/query_builder_test.go +++ b/api/query_builder_test.go @@ -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) {