fix(test): don't cross two month boundaries when anticipating +1 perk

This commit is contained in:
SabreCat
2023-03-14 16:27:09 -05:00
parent 5359a2bf3d
commit bbea789700

View File

@@ -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({