X Tutup
Skip to content

Commit 3f940c9

Browse files
committed
Add assertion for 1st api request before pagination
1 parent 7907def commit 3f940c9

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

pkg/cmd/api/api_test.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,8 @@ func Test_apiRun_pagination(t *testing.T) {
331331
return &http.Client{Transport: tr}, nil
332332
},
333333

334-
Paginate: true,
334+
RequestPath: "issues",
335+
Paginate: true,
335336
}
336337

337338
err := apiRun(&options)
@@ -340,6 +341,7 @@ func Test_apiRun_pagination(t *testing.T) {
340341
assert.Equal(t, `{"page":1}{"page":2}{"page":3}`, stdout.String(), "stdout")
341342
assert.Equal(t, "", stderr.String(), "stderr")
342343

344+
assert.Equal(t, "https://api.github.com/issues", responses[0].Request.URL.String())
343345
assert.Equal(t, "https://api.github.com/repositories/1227/issues?page=2", responses[1].Request.URL.String())
344346
assert.Equal(t, "https://api.github.com/repositories/1227/issues?page=3", responses[2].Request.URL.String())
345347
}

0 commit comments

Comments
 (0)
X Tutup