Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Enhance cursor pagination test for more coverage
  • Loading branch information
mumoshu committed Jul 6, 2021
commit 23922a838e3b17c930068442afd23185e878216c
14 changes: 14 additions & 0 deletions github/github_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -635,6 +635,20 @@ func TestResponse_cursorPagination(t *testing.T) {
if got, want := response.NextPageToken, "url-encoded-next-page-token"; want != got {
t.Errorf("response.NextPageToken: %v, want %v", got, want)
}

// cursor-based pagination with "cursor" param
r = http.Response{
Header: http.Header{
"Link": {
`<https://api.github.com/?cursor=v1_12345678>; rel="next"`,
},
},
}

response = newResponse(&r)
if got, want := response.Cursor, "v1_12345678"; got != want {
t.Errorf("response.Cursor: %v, want %v", got, want)
}
}

func TestResponse_populatePageValues_invalid(t *testing.T) {
Expand Down