Skip to content

Commit 715be39

Browse files
authored
Fix application of pagination options on ListCopilotSeats endpoint (#3090)
1 parent 108f958 commit 715be39

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

github/copilot_test.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,10 @@ func TestCopilotService_ListCopilotSeats(t *testing.T) {
336336

337337
mux.HandleFunc("/orgs/o/copilot/billing/seats", func(w http.ResponseWriter, r *http.Request) {
338338
testMethod(t, r, "GET")
339+
testFormValues(t, r, values{
340+
"per_page": "100",
341+
"page": "1",
342+
})
339343
fmt.Fprint(w, `{
340344
"total_seats": 4,
341345
"seats": [
@@ -473,7 +477,8 @@ func TestCopilotService_ListCopilotSeats(t *testing.T) {
473477
lastActivityAt2 := Timestamp{tmp}
474478

475479
ctx := context.Background()
476-
got, _, err := client.Copilot.ListCopilotSeats(ctx, "o", nil)
480+
opts := &ListOptions{Page: 1, PerPage: 100}
481+
got, _, err := client.Copilot.ListCopilotSeats(ctx, "o", opts)
477482
if err != nil {
478483
t.Errorf("Copilot.ListCopilotSeats returned error: %v", err)
479484
}
@@ -591,7 +596,7 @@ func TestCopilotService_ListCopilotSeats(t *testing.T) {
591596
})
592597

593598
testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {
594-
got, resp, err := client.Copilot.ListCopilotSeats(ctx, "", nil)
599+
got, resp, err := client.Copilot.ListCopilotSeats(ctx, "o", opts)
595600
if got != nil {
596601
t.Errorf("Copilot.ListCopilotSeats returned %+v, want nil", got)
597602
}

0 commit comments

Comments
 (0)