feat: added username to IAP purchaseProduct method (#35902)

This commit is contained in:
Michał Zarach 2022-12-12 19:11:48 +01:00 committed by GitHub
parent 4e66184287
commit 6a798b1c58
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 39 additions and 11 deletions

View file

@ -39,12 +39,17 @@ describe('inAppPurchase module', function () {
// without relying on a remote service.
xdescribe('handles product purchases', () => {
it('purchaseProduct() fails when buying invalid product', async () => {
const success = await inAppPurchase.purchaseProduct('non-exist');
expect(success).to.be.false('failed to purchase non-existent product');
});
it('purchaseProduct() accepts optional (Integer) argument', async () => {
const success = await inAppPurchase.purchaseProduct('non-exist', 1);
expect(success).to.be.false('failed to purchase non-existent product');
});
it('purchaseProduct() accepts optional arguments', async () => {
const success = await inAppPurchase.purchaseProduct('non-exist');
it('purchaseProduct() accepts optional (Object) argument', async () => {
const success = await inAppPurchase.purchaseProduct('non-exist', { quantity: 1, username: 'username' });
expect(success).to.be.false('failed to purchase non-existent product');
});