Skip to content

Commit

Permalink
fix: fixes unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
cb-haripriyan committed Jul 18, 2023
1 parent d0b5ee5 commit a3056ca
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/__tests__/index.test.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { NativeModules, Platform } from 'react-native';
import Chargebee, {
Customer,
EntitlementsRequest,
ProductIdentifiersRequest,
SubscriptionsRequest,
} from '../index';
Expand Down Expand Up @@ -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);
});
});

0 comments on commit a3056ca

Please sign in to comment.