mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 14:47:53 +01:00
fix(test): don't cross two month boundaries when anticipating +1 perk
This commit is contained in:
@@ -337,9 +337,12 @@ describe('cron', async () => {
|
|||||||
expect(user1.purchased.plan.consecutive.gemCapExtra).to.equal(15);
|
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;
|
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')
|
.add(2, 'days')
|
||||||
.toDate());
|
.toDate());
|
||||||
await cron({
|
await cron({
|
||||||
|
|||||||
Reference in New Issue
Block a user