Skip to content

Commit

Permalink
Update changelog, cursor -> lastcursor
Browse files Browse the repository at this point in the history
  • Loading branch information
jos-oai committed Mar 15, 2024
1 parent cdbc529 commit 49f1208
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1542,23 +1542,23 @@ func Test_Client_JobList(t *testing.T) {
res, err := client.JobList(ctx, NewJobListParams().States(rivertype.JobStateAvailable).After(JobListCursorFromJob(job1, JobListOrderByTime)))
require.NoError(t, err)
require.Equal(t, []int64{job2.ID}, sliceutil.Map(res.Jobs, func(job *rivertype.JobRow) int64 { return job.ID }))
require.Equal(t, job2.ID, res.Cursor.id)
require.Equal(t, job2.ID, res.LastCursor.id)

res, err = client.JobList(ctx, NewJobListParams().States(rivertype.JobStateRunning).After(JobListCursorFromJob(job3, JobListOrderByTime)))
require.NoError(t, err)
require.Equal(t, []int64{job4.ID}, sliceutil.Map(res.Jobs, func(job *rivertype.JobRow) int64 { return job.ID }))
require.Equal(t, job4.ID, res.Cursor.id)
require.Equal(t, job4.ID, res.LastCursor.id)

res, err = client.JobList(ctx, NewJobListParams().States(rivertype.JobStateCompleted).After(JobListCursorFromJob(job5, JobListOrderByTime)))
require.NoError(t, err)
require.Equal(t, []int64{job6.ID}, sliceutil.Map(res.Jobs, func(job *rivertype.JobRow) int64 { return job.ID }))
require.Equal(t, job6.ID, res.Cursor.id)
require.Equal(t, job6.ID, res.LastCursor.id)

res, err = client.JobList(ctx, NewJobListParams().OrderBy(JobListOrderByScheduledAt, SortOrderAsc).After(JobListCursorFromJob(job4, JobListOrderByScheduledAt)))
require.NoError(t, err)
require.Equal(t, []int64{job1.ID, job3.ID, job2.ID}, sliceutil.Map(res.Jobs, func(job *rivertype.JobRow) int64 { return job.ID }))
require.Equal(t, JobListOrderByScheduledAt, res.Cursor.sortField)
require.Equal(t, job2.ID, res.Cursor.id)
require.Equal(t, JobListOrderByScheduledAt, res.LastCursor.sortField)
require.Equal(t, job2.ID, res.LastCursor.id)
})

t.Run("MetadataOnly", func(t *testing.T) {
Expand Down

0 comments on commit 49f1208

Please sign in to comment.