remove wrong test

This commit is contained in:
Phillip Thelen
2023-02-27 13:30:44 +01:00
parent c29049146d
commit def24142ca
2 changed files with 1 additions and 76 deletions

View File

@@ -452,80 +452,6 @@ describe('Apple Payments', () => {
});
});
it('allows second user to subscribe if initial subscription is cancelled', async () => {
user.profile.name = 'sender';
user.purchased.plan.paymentMethod = applePayments.constants.PAYMENT_METHOD_APPLE;
user.purchased.plan.customerId = token;
user.purchased.plan.planId = common.content.subscriptionBlocks.basic_3mo.key;
user.purchased.plan.additionalData = receipt;
user.purchased.plan.dateTerminated = moment.utc().subtract({ day: 1 }).toDate();
await user.save();
iap.getPurchaseData.restore();
iapGetPurchaseDataStub = sinon.stub(iap, 'getPurchaseData')
.returns([{
expirationDate: moment.utc().add({ day: 3 }).toDate(),
purchaseDate: moment.utc().toDate(),
productId: sku,
transactionId: `${token}new`,
originalTransactionId: token,
}]);
const secondUser = new User();
await secondUser.save();
await applePayments.subscribe(secondUser, receipt, headers, nextPaymentProcessing);
expect(paymentsCreateSubscritionStub).to.be.calledOnce;
expect(paymentsCreateSubscritionStub).to.be.calledWith({
user: secondUser,
customerId: token,
paymentMethod: applePayments.constants.PAYMENT_METHOD_APPLE,
sub,
headers,
additionalData: receipt,
nextPaymentProcessing,
});
});
it('allows second user to subscribe if multiple initial subscription are cancelled', async () => {
user.profile.name = 'sender';
user.purchased.plan.paymentMethod = applePayments.constants.PAYMENT_METHOD_APPLE;
user.purchased.plan.customerId = token;
user.purchased.plan.planId = common.content.subscriptionBlocks.basic_3mo.key;
user.purchased.plan.additionalData = receipt;
user.purchased.plan.dateTerminated = moment.utc().subtract({ day: 1 }).toDate();
await user.save();
const secondUser = new User();
secondUser.purchased.plan = user.purchased.plan;
await secondUser.save();
iap.getPurchaseData.restore();
iapGetPurchaseDataStub = sinon.stub(iap, 'getPurchaseData')
.returns([{
expirationDate: moment.utc().add({ day: 3 }).toDate(),
purchaseDate: moment.utc().toDate(),
productId: sku,
transactionId: `${token}new`,
originalTransactionId: token,
}]);
const thirdUser = new User();
await thirdUser.save();
await applePayments.subscribe(thirdUser, receipt, headers, nextPaymentProcessing);
expect(paymentsCreateSubscritionStub).to.be.calledOnce;
expect(paymentsCreateSubscritionStub).to.be.calledWith({
user: thirdUser,
customerId: token,
paymentMethod: applePayments.constants.PAYMENT_METHOD_APPLE,
sub,
headers,
additionalData: receipt,
nextPaymentProcessing,
});
});
describe('does not apply multiple times', async () => {
it('errors when a user is using the same subscription', async () => {
payments.createSubscription.restore();