mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-07-20 10:44:13 +00:00
fix tests
This commit is contained in:
parent
6ee2e3a379
commit
2d5dcae406
2 changed files with 1 additions and 16 deletions
|
|
@ -215,6 +215,7 @@ describe('cron utility functions', () => {
|
|||
|
||||
it('monthly plan, next date in 3 months', () => {
|
||||
const user = baseUserData(60, 0, 'group_plan_auto');
|
||||
user.purchased.plan.perkMonthCount = 0;
|
||||
|
||||
const planContext = getPlanContext(user, now);
|
||||
|
||||
|
|
|
|||
|
|
@ -117,22 +117,6 @@ async function prepareSubscriptionValues (data) {
|
|||
let recipientIsSubscribed = recipient.isSubscribed();
|
||||
const isNewSubscription = !recipientIsSubscribed;
|
||||
|
||||
if (data.user && !data.gift && !data.groupId) {
|
||||
const unlockedUser = await User.findOneAndUpdate(
|
||||
{
|
||||
_id: data.user._id,
|
||||
$or: [
|
||||
{ _subSignature: 'NOT_RUNNING' },
|
||||
{ _subSignature: { $exists: false } },
|
||||
],
|
||||
},
|
||||
{ $set: { _subSignature: 'SUB_IN_PROGRESS' } },
|
||||
);
|
||||
if (!unlockedUser) {
|
||||
throw new NotFound('User not found or subscription already processing.');
|
||||
}
|
||||
}
|
||||
|
||||
// If we are buying a group subscription
|
||||
if (data.groupId) {
|
||||
const groupFields = basicGroupFields.concat(' purchased');
|
||||
|
|
|
|||
Loading…
Reference in a new issue