X Tutup
Skip to content

Commit f9b50ac

Browse files
committed
add mock for milestones on issue list
1 parent 9a5e69a commit f9b50ac

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

command/issue_test.go

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -170,13 +170,18 @@ func TestIssueList_tty_withFlags(t *testing.T) {
170170
assert.Equal(t, "probablyCher", params["assignee"].(string))
171171
assert.Equal(t, "foo", params["author"].(string))
172172
assert.Equal(t, "me", params["mention"].(string))
173+
assert.Equal(t, "12345", params["milestone"].(string)) // Database ID for the Milestone (see #1441)
173174
assert.Equal(t, []interface{}{"web", "bug"}, params["labels"].([]interface{}))
174175
assert.Equal(t, []interface{}{"OPEN"}, params["states"].([]interface{}))
175176
}))
176177
http.Register(
177-
httpmock.REST("GET", "repos/OWNER/REPO/milestones"),
178-
httpmock.StringResponse("[]"),
179-
)
178+
httpmock.GraphQL(`query RepositoryMilestoneList\b`),
179+
httpmock.StringResponse(`
180+
{ "data": { "repository": { "milestones": {
181+
"nodes": [{ "title":"1.x", "id": "MDk6TWlsZXN0b25lMTIzNDU=" }],
182+
"pageInfo": { "hasNextPage": false }
183+
} } } }
184+
`))
180185

181186
output, err := RunCommand("issue list -a probablyCher -l web,bug -s open -A foo --mention me --milestone 1.x")
182187
if err != nil {

0 commit comments

Comments
 (0)
X Tutup