From 1117477da2957b1840901b6a11320d51e314752c Mon Sep 17 00:00:00 2001 From: Andy Feller Date: Mon, 22 Dec 2025 10:16:21 -0500 Subject: [PATCH] Add test to ensure null values are skipped --- api/queries_projects_v2_test.go | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/api/queries_projects_v2_test.go b/api/queries_projects_v2_test.go index fae49c926..3d29a19c1 100644 --- a/api/queries_projects_v2_test.go +++ b/api/queries_projects_v2_test.go @@ -129,6 +129,17 @@ func TestProjectsV2ItemsForIssue(t *testing.T) { }, expectError: true, }, + { + name: "skips null project items for issue", + httpStubs: func(reg *httpmock.Registry) { + reg.Register( + httpmock.GraphQL(`query IssueProjectItems\b`), + httpmock.GraphQLQuery(`{"data":{"repository":{"issue":{"projectItems":{"totalCount":1,"nodes":[null]}}}}}`, + func(query string, inputs map[string]interface{}) {}), + ) + }, + expectItems: ProjectItems{}, + }, } for _, tt := range tests { @@ -186,6 +197,17 @@ func TestProjectsV2ItemsForPullRequest(t *testing.T) { }, expectError: true, }, + { + name: "skips null project items for pull request", + httpStubs: func(reg *httpmock.Registry) { + reg.Register( + httpmock.GraphQL(`query PullRequestProjectItems\b`), + httpmock.GraphQLQuery(`{"data":{"repository":{"pullRequest":{"projectItems":{"totalCount":1,"nodes":[null]}}}}}`, + func(query string, inputs map[string]interface{}) {}), + ) + }, + expectItems: ProjectItems{}, + }, { name: "retrieves project items that have status columns", httpStubs: func(reg *httpmock.Registry) {