Skip to content

Commit

Permalink
Fix application of pagination options on ListCopilotSeats endpoint (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanskidmore committed Apr 29, 2024
1 parent 108f958 commit 715be39
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions github/copilot_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,10 @@ func TestCopilotService_ListCopilotSeats(t *testing.T) {

mux.HandleFunc("/orgs/o/copilot/billing/seats", func(w http.ResponseWriter, r *http.Request) {
testMethod(t, r, "GET")
testFormValues(t, r, values{
"per_page": "100",
"page": "1",
})
fmt.Fprint(w, `{
"total_seats": 4,
"seats": [
Expand Down Expand Up @@ -473,7 +477,8 @@ func TestCopilotService_ListCopilotSeats(t *testing.T) {
lastActivityAt2 := Timestamp{tmp}

ctx := context.Background()
got, _, err := client.Copilot.ListCopilotSeats(ctx, "o", nil)
opts := &ListOptions{Page: 1, PerPage: 100}
got, _, err := client.Copilot.ListCopilotSeats(ctx, "o", opts)
if err != nil {
t.Errorf("Copilot.ListCopilotSeats returned error: %v", err)
}
Expand Down Expand Up @@ -591,7 +596,7 @@ func TestCopilotService_ListCopilotSeats(t *testing.T) {
})

testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {
got, resp, err := client.Copilot.ListCopilotSeats(ctx, "", nil)
got, resp, err := client.Copilot.ListCopilotSeats(ctx, "o", opts)
if got != nil {
t.Errorf("Copilot.ListCopilotSeats returned %+v, want nil", got)
}
Expand Down

0 comments on commit 715be39

Please sign in to comment.