Skip to content

Commit 8f1eb1d

Browse files
committed
Correct lower-case issue state
1 parent 82c4930 commit 8f1eb1d

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

pkg/github/issues.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1384,7 +1384,7 @@ func ListIssues(getGQLClient GetGQLClientFn, t translations.TranslationHelperFun
13841384
// If the state has a value, cast into an array of strings
13851385
var states []githubv4.IssueState
13861386
if state != "" {
1387-
states = append(states, githubv4.IssueState(state))
1387+
states = append(states, githubv4.IssueState(strings.ToUpper(state)))
13881388
} else {
13891389
states = []githubv4.IssueState{githubv4.IssueStateOpen, githubv4.IssueStateClosed}
13901390
}

pkg/github/issues_test.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1183,6 +1183,16 @@ func Test_ListIssues(t *testing.T) {
11831183
expectError: false,
11841184
expectedCount: 2,
11851185
},
1186+
{
1187+
name: "filter by open state - lc",
1188+
reqParams: map[string]interface{}{
1189+
"owner": "owner",
1190+
"repo": "repo",
1191+
"state": "open",
1192+
},
1193+
expectError: false,
1194+
expectedCount: 2,
1195+
},
11861196
{
11871197
name: "filter by closed state",
11881198
reqParams: map[string]interface{}{
@@ -1229,6 +1239,9 @@ func Test_ListIssues(t *testing.T) {
12291239
case "filter by open state":
12301240
matcher := githubv4mock.NewQueryMatcher(qBasicNoLabels, varsOpenOnly, mockResponseOpenOnly)
12311241
httpClient = githubv4mock.NewMockedHTTPClient(matcher)
1242+
case "filter by open state - lc":
1243+
matcher := githubv4mock.NewQueryMatcher(qBasicNoLabels, varsOpenOnly, mockResponseOpenOnly)
1244+
httpClient = githubv4mock.NewMockedHTTPClient(matcher)
12321245
case "filter by closed state":
12331246
matcher := githubv4mock.NewQueryMatcher(qBasicNoLabels, varsClosedOnly, mockResponseClosedOnly)
12341247
httpClient = githubv4mock.NewMockedHTTPClient(matcher)

0 commit comments

Comments
 (0)