From 0c069b13853e5ea319bbe87946510c95208f46c7 Mon Sep 17 00:00:00 2001 From: Christopher Kolstad Date: Tue, 10 Oct 2023 13:23:20 +0200 Subject: [PATCH] fix: added await to getActiveUsers tests --- .../instance-stats/getActiveUsers.e2e.test.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/lib/features/instance-stats/getActiveUsers.e2e.test.ts b/src/lib/features/instance-stats/getActiveUsers.e2e.test.ts index 28717ff4b6..291309be6d 100644 --- a/src/lib/features/instance-stats/getActiveUsers.e2e.test.ts +++ b/src/lib/features/instance-stats/getActiveUsers.e2e.test.ts @@ -41,7 +41,7 @@ afterAll(async () => { }); test('should return 0 users', async () => { - expect(getActiveUsers()).resolves.toEqual({ + await expect(getActiveUsers()).resolves.toEqual({ last7: 0, last30: 0, last60: 0, @@ -52,7 +52,7 @@ test('should return 0 users', async () => { test('should return 1 user', async () => { await db.rawDatabase('users').insert(mockUserDaysAgo(1)); - expect(getActiveUsers()).resolves.toEqual({ + await expect(getActiveUsers()).resolves.toEqual({ last7: 1, last30: 1, last60: 1, @@ -72,7 +72,7 @@ test('should handle intervals of activity', async () => { mockUserDaysAgo(100), ]); - expect(getActiveUsers()).resolves.toEqual({ + await expect(getActiveUsers()).resolves.toEqual({ last7: 1, last30: 3, last60: 4, @@ -90,7 +90,7 @@ test('should count user as active if they have an active token', async () => { .rawDatabase('personal_access_tokens') .insert(mockTokenDaysAgo(userId, 31)); - expect(getActiveUsers()).resolves.toEqual({ + await expect(getActiveUsers()).resolves.toEqual({ last7: 0, last30: 0, last60: 1, @@ -112,7 +112,7 @@ test('should prioritize user seen_at if newer then token seen_at', async () => { mockTokenDaysAgo(userId, 91), ]); - expect(getActiveUsers()).resolves.toEqual({ + await expect(getActiveUsers()).resolves.toEqual({ last7: 0, last30: 1, last60: 1, @@ -145,7 +145,7 @@ test('should handle multiple users and with multiple tokens', async () => { mockTokenDaysAgo(users[4].id, 91), ]); - expect(getActiveUsers()).resolves.toEqual({ + await expect(getActiveUsers()).resolves.toEqual({ last7: 2, last30: 3, last60: 4,