1
0
Fork 0
forked from forgejo/forgejo

Add pagination for dashboard and user activity feeds (#22937)

Previously only the last few activities where available. This works for
all activity and for activity on a date chosen on the heatmap.
This commit is contained in:
Brecht Van Lommel 2023-02-24 22:15:10 +01:00 committed by GitHub
parent 740a5ecdd9
commit f4920c9c7f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 81 additions and 32 deletions

View file

@ -73,7 +73,7 @@ func TestGetUserHeatmapDataByUser(t *testing.T) {
}
// get the action for comparison
actions, err := activities_model.GetFeeds(db.DefaultContext, activities_model.GetFeedsOptions{
actions, count, err := activities_model.GetFeeds(db.DefaultContext, activities_model.GetFeedsOptions{
RequestedUser: user,
Actor: doer,
IncludePrivate: true,
@ -90,6 +90,7 @@ func TestGetUserHeatmapDataByUser(t *testing.T) {
}
assert.NoError(t, err)
assert.Len(t, actions, contributions, "invalid action count: did the test data became too old?")
assert.Equal(t, count, int64(contributions))
assert.Equal(t, tc.CountResult, contributions, fmt.Sprintf("testcase '%s'", tc.desc))
// Test JSON rendering