Add test to ensure null values are skipped
This commit is contained in:
parent
4a106c1acf
commit
1117477da2
1 changed files with 22 additions and 0 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue