/**
* External dependencies
*/
import TestRenderer, { act } from 'react-test-renderer';
import { createRegistry, RegistryProvider } from '@wordpress/data';
/**
* Internal dependencies
*/
import { useCheckoutSubmit } from '../use-checkout-submit';
import {
CHECKOUT_STORE_KEY,
config as checkoutStoreConfig,
} from '../../../../data/checkout';
import {
PAYMENT_STORE_KEY,
config as paymentDataStoreConfig,
} from '../../../../data/payment';
jest.mock( '../../providers/cart-checkout/checkout-events', () => {
const original = jest.requireActual(
'../../providers/cart-checkout/checkout-events'
);
return {
...original,
useCheckoutEventsContext: () => {
return { onSubmit: jest.fn() };
},
};
} );
describe( 'useCheckoutSubmit', () => {
let registry, renderer;
const getWrappedComponents = ( Component ) => (