Add tests for issue and PR project items query building
This commit is contained in:
parent
83418cba54
commit
8a9eb7bfc2
1 changed files with 10 additions and 0 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue