From 2a5fab3e9c7e97519ee7948ecb49cc3dba026c73 Mon Sep 17 00:00:00 2001 From: Kalle <38327916+Sendouc@users.noreply.github.com> Date: Sun, 2 Mar 2025 22:41:08 +0200 Subject: [PATCH] Unit test for 55f1544 --- app/features/admin/routes/admin.test.ts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/app/features/admin/routes/admin.test.ts b/app/features/admin/routes/admin.test.ts index 2d23a27b8..2cea5d31f 100644 --- a/app/features/admin/routes/admin.test.ts +++ b/app/features/admin/routes/admin.test.ts @@ -222,6 +222,23 @@ describe("Plus voting", () => { expect(await countPlusTierMembers(1)).toBe(1); }); + test("gives membership if failed voting and is on the leaderboard and season ended last month", async () => { + vi.setSystemTime(new Date("2023-12-29T00:00:00.000Z")); + + await dbInsertUsers(1); + await PlusVotingRepository.upsertMany([ + voteArgs({ + score: -1, + votedId: 1, + }), + ]); + await createLeaderboard([1]); + + await adminAction({ _action: "REFRESH" }, { user: "admin" }); + + expect(await countPlusTierMembers(1)).toBe(1); + }); + test("members who fails voting drops one tier", async () => { vi.setSystemTime(new Date("2024-02-15T00:00:00.000Z"));