From a3056cae0896503a6ca5c8d5fe480245e1ea726b Mon Sep 17 00:00:00 2001 From: haripriyan Date: Tue, 18 Jul 2023 13:51:13 +0530 Subject: [PATCH] fix: fixes unit tests --- src/__tests__/index.test.tsx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/__tests__/index.test.tsx b/src/__tests__/index.test.tsx index 3b245bf..2235014 100644 --- a/src/__tests__/index.test.tsx +++ b/src/__tests__/index.test.tsx @@ -1,6 +1,7 @@ import { NativeModules, Platform } from 'react-native'; import Chargebee, { Customer, + EntitlementsRequest, ProductIdentifiersRequest, SubscriptionsRequest, } from '../index'; @@ -155,15 +156,16 @@ describe('Chargebee React Native', () => { }); it('retrieve entitlements receipt by Subscription ID', async () => { - const subscriptionId = 'subscription-id-1'; - - await Chargebee.retrieveEntitlements(subscriptionId); + const request: EntitlementsRequest = { + subscriptionId: 'subscription-id-1', + }; + await Chargebee.retrieveEntitlements(request); expect( NativeModules.ChargebeeReactNative.retrieveEntitlements ).toBeCalledTimes(1); expect( NativeModules.ChargebeeReactNative.retrieveEntitlements - ).toHaveBeenCalledWith(subscriptionId); + ).toHaveBeenCalledWith(request); }); });