From bbea7897006519b331b3fad84a9f96644ecd9b73 Mon Sep 17 00:00:00 2001 From: SabreCat Date: Tue, 14 Mar 2023 16:27:09 -0500 Subject: [PATCH] fix(test): don't cross two month boundaries when anticipating +1 perk --- test/api/unit/libs/cron.test.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/test/api/unit/libs/cron.test.js b/test/api/unit/libs/cron.test.js index 6c6a08b985..6757228033 100644 --- a/test/api/unit/libs/cron.test.js +++ b/test/api/unit/libs/cron.test.js @@ -337,9 +337,12 @@ describe('cron', async () => { expect(user1.purchased.plan.consecutive.gemCapExtra).to.equal(15); }); - it('initialized plan.perkMonthCount if necessary', async () => { + it('initializes plan.perkMonthCount if necessary', async () => { user.purchased.plan.perkMonthCount = undefined; - clock = sinon.useFakeTimers(moment().utcOffset(0).startOf('month').add(1, 'months') + clock = sinon.useFakeTimers(moment(user.purchased.plan.dateUpdated) + .utcOffset(0) + .startOf('month') + .add(1, 'months') .add(2, 'days') .toDate()); await cron({