/**
* 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_METHOD_DATA_STORE_KEY,
config as paymentDataStoreConfig,
} from '../../../../data/payment-methods';
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 ) => (