aboutsummaryrefslogtreecommitdiff
path: root/userapi/storage/tables/stats_table_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'userapi/storage/tables/stats_table_test.go')
-rw-r--r--userapi/storage/tables/stats_table_test.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/userapi/storage/tables/stats_table_test.go b/userapi/storage/tables/stats_table_test.go
index b088d15c..969bc530 100644
--- a/userapi/storage/tables/stats_table_test.go
+++ b/userapi/storage/tables/stats_table_test.go
@@ -187,8 +187,8 @@ func Test_UserStatistics(t *testing.T) {
})
t.Run("Users not active for one/two month", func(t *testing.T) {
- mustUpdateDeviceLastSeen(t, ctx, db, "user1", time.Now().AddDate(0, -2, 0))
- mustUpdateDeviceLastSeen(t, ctx, db, "user2", time.Now().AddDate(0, -1, 0))
+ mustUpdateDeviceLastSeen(t, ctx, db, "user1", time.Now().AddDate(0, 0, -60))
+ mustUpdateDeviceLastSeen(t, ctx, db, "user2", time.Now().AddDate(0, 0, -30))
gotStats, _, err := statsDB.UserStatistics(ctx, nil)
if err != nil {
t.Fatalf("unexpected error: %v", err)
@@ -224,9 +224,9 @@ func Test_UserStatistics(t *testing.T) {
- Where account creation and last_seen are > 30 days apart
*/
t.Run("R30Users tests", func(t *testing.T) {
- mustUserUpdateRegistered(t, ctx, db, "user1", time.Now().AddDate(0, -2, 0))
+ mustUserUpdateRegistered(t, ctx, db, "user1", time.Now().AddDate(0, 0, -60))
mustUpdateDeviceLastSeen(t, ctx, db, "user1", time.Now())
- mustUserUpdateRegistered(t, ctx, db, "user4", time.Now().AddDate(0, -2, 0))
+ mustUserUpdateRegistered(t, ctx, db, "user4", time.Now().AddDate(0, 0, -60))
mustUpdateDeviceLastSeen(t, ctx, db, "user4", time.Now())
startTime := time.Now().AddDate(0, 0, -2)
err := statsDB.UpdateUserDailyVisits(ctx, nil, startTime, startTime.Truncate(time.Hour*24))