mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 06:37:23 +01:00
Allow gems and subs to be gifted through in-app-purchases (#10892)
* Allow gems to be gifted through IAPs * implement non recurring IAP subscriptions * fix localization issue in error * fix non renewing subscription handling * Fix lint error * fix tests * move findbyId mock to helper file * undo package-lock changes * Fix lint error
This commit is contained in:
committed by
Matteo Pagliazzi
parent
88f28188a1
commit
cfbfec34aa
20
test/helpers/mongoose.helper.js
Normal file
20
test/helpers/mongoose.helper.js
Normal file
@@ -0,0 +1,20 @@
|
||||
import mongoose from 'mongoose';
|
||||
|
||||
export async function mockFindById (response) {
|
||||
const mockFind = {
|
||||
select () {
|
||||
return this;
|
||||
},
|
||||
lean () {
|
||||
return this;
|
||||
},
|
||||
exec () {
|
||||
return Promise.resolve(response);
|
||||
},
|
||||
};
|
||||
sinon.stub(mongoose.Model, 'findById').returns(mockFind);
|
||||
}
|
||||
|
||||
export function restoreFindById () {
|
||||
return mongoose.Model.findById.restore();
|
||||
}
|
||||
Reference in New Issue
Block a user