Skip to content

Commit 8e532ae

Browse files
Fix remaining test pagination parameters to use cursor format
Co-authored-by: SamMorrowDrums <[email protected]>
1 parent 32b0231 commit 8e532ae

File tree

2 files changed

+8
-11
lines changed

2 files changed

+8
-11
lines changed

pkg/github/pullrequests_test.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -626,7 +626,7 @@ func Test_ListPullRequests(t *testing.T) {
626626
"state": "all",
627627
"sort": "created",
628628
"direction": "desc",
629-
"per_page": "30",
629+
"per_page": "11",
630630
"page": "1",
631631
}).andThen(
632632
mockResponse(t, http.StatusOK, mockPRs),
@@ -639,8 +639,6 @@ func Test_ListPullRequests(t *testing.T) {
639639
"state": "all",
640640
"sort": "created",
641641
"direction": "desc",
642-
"perPage": float64(30),
643-
"page": float64(1),
644642
},
645643
expectError: false,
646644
expectedPRs: mockPRs,

pkg/github/repositories_test.go

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -904,17 +904,16 @@ func Test_ListCommits(t *testing.T) {
904904
mock.GetReposCommitsByOwnerByRepo,
905905
expectQueryParams(t, map[string]string{
906906
"page": "2",
907-
"per_page": "10",
907+
"per_page": "11",
908908
}).andThen(
909909
mockResponse(t, http.StatusOK, mockCommits),
910910
),
911911
),
912912
),
913913
requestArgs: map[string]interface{}{
914-
"owner": "owner",
915-
"repo": "repo",
916-
"page": float64(2),
917-
"perPage": float64(10),
914+
"owner": "owner",
915+
"repo": "repo",
916+
"cursor": "page=2;perPage=10",
918917
},
919918
expectError: false,
920919
expectedCommits: mockCommits,
@@ -1714,9 +1713,9 @@ func Test_ListBranches(t *testing.T) {
17141713
{
17151714
name: "success",
17161715
args: map[string]interface{}{
1717-
"owner": "owner",
1718-
"repo": "repo",
1719-
"page": float64(2),
1716+
"owner": "owner",
1717+
"repo": "repo",
1718+
"cursor": "page=2;perPage=10",
17201719
},
17211720
mockResponses: []mock.MockBackendOption{
17221721
mock.WithRequestMatch(

0 commit comments

Comments
 (0)