mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-15 21:57:22 +01:00
Fix one-off issue for monthly subs (#14643)
* Fix initial plan.consecutive.offset for 1 month subs * fix initial values for group plan subs * Make perkMonthCount editable in admin panel * Add aditional info to admin panel * Implement automatic fix for affected users * fix(lint): exclusive test, code style * fixes * fix issue with initialization --------- Co-authored-by: SabreCat <sabe@habitica.com>
This commit is contained in:
@@ -748,9 +748,19 @@ describe('payments/index', () => {
|
||||
});
|
||||
|
||||
it('does not add to plans.consecutive.offset if 1 month subscription', async () => {
|
||||
data.sub.key = 'basic_earned';
|
||||
await api.createSubscription(data);
|
||||
|
||||
expect(user.purchased.plan.extraMonths).to.eql(0);
|
||||
expect(user.purchased.plan.consecutive.offset).to.eql(0);
|
||||
});
|
||||
|
||||
it('resets plans.consecutive.offset if 1 month subscription', async () => {
|
||||
user.purchased.plan.consecutive.offset = 1;
|
||||
await user.save();
|
||||
data.sub.key = 'basic_earned';
|
||||
await api.createSubscription(data);
|
||||
|
||||
expect(user.purchased.plan.consecutive.offset).to.eql(0);
|
||||
});
|
||||
|
||||
it('adds 5 to plan.consecutive.gemCapExtra for 3 month block', async () => {
|
||||
|
||||
Reference in New Issue
Block a user