Skip to content

Commit

Permalink
Add test for invalidate
Browse files Browse the repository at this point in the history
  • Loading branch information
markmur committed Oct 24, 2024
1 parent 64db06b commit f751f90
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions modules/@shopify/checkout-sheet-kit/tests/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ jest.mock('react-native', () => {
version: '0.7.0',
preload: jest.fn(),
present: jest.fn(),
invalidateCache: jest.fn(),
getConfig: jest.fn(async () => exampleConfig),
setConfig: jest.fn(),
addEventListener: jest.fn(),
Expand Down Expand Up @@ -123,6 +124,16 @@ describe('ShopifyCheckoutSheetKit', () => {
});
});

describe('invalidate', () => {
it('calls `invalidateCache`', () => {
const instance = new ShopifyCheckoutSheet();
instance.invalidate();
expect(
NativeModules.ShopifyCheckoutSheetKit.invalidateCache,
).toHaveBeenCalledTimes(1);
});
});

describe('present', () => {
it('calls `present` with a checkout URL', () => {
const instance = new ShopifyCheckoutSheet();
Expand Down

0 comments on commit f751f90

Please sign in to comment.