Skip to content

Commit a7dead1

Browse files
committed
Add tests
1 parent bf11908 commit a7dead1

File tree

1 file changed

+0
-61
lines changed

1 file changed

+0
-61
lines changed

modules/ppcp-settings/resources/js/Components/Screens/Onboarding/hooks/usePaymentConfig.test.js

Lines changed: 0 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,72 +1,11 @@
11
/* global describe, test, expect, jest */
22
import { renderHook } from '@testing-library/react';
33
import { usePaymentConfig } from './usePaymentConfig';
4-
import {
5-
CardFields,
6-
CreditDebitCards,
7-
DigitalWallets,
8-
} from '../Components/PaymentOptions';
9-
10-
jest.mock( '../../../../data/onboarding', () => ( {
11-
hooks: {},
12-
selectors: {},
13-
STORE_NAME: 'test/store',
14-
initStore: jest.fn().mockReturnValue( true ),
15-
} ) );
164

175
jest.mock( '../../../../data', () => ( {
186
initStores: jest.fn(),
197
} ) );
208

21-
jest.mock( '@wordpress/i18n', () => ( {
22-
__: ( text ) => text,
23-
} ) );
24-
25-
jest.mock( '@wordpress/element', () => ( {
26-
useMemo: ( callback ) => callback(),
27-
useEffect: ( callback ) => callback(),
28-
useState: ( initialState ) => [ initialState, jest.fn() ],
29-
createContext: () => ( {
30-
Provider: ( { children } ) => children,
31-
Consumer: ( { children } ) => children,
32-
} ),
33-
forwardRef: ( Component ) => Component,
34-
Fragment: ( { children } ) => children,
35-
} ) );
36-
37-
jest.mock( '@wordpress/data', () => ( {
38-
useDispatch: () => ( {} ),
39-
useSelect: () => ( {} ),
40-
createReduxStore: () => ( {} ),
41-
register: () => {},
42-
select: () => ( {} ),
43-
} ) );
44-
45-
jest.mock( '@wordpress/compose', () => ( {
46-
createHigherOrderComponent: () => ( Component ) => Component,
47-
withInstanceId: ( Component ) => Component,
48-
} ) );
49-
50-
jest.mock( '@wordpress/components', () => ( {
51-
Button: ( { children, ...props } ) => (
52-
<button { ...props }>{ children }</button>
53-
),
54-
} ) );
55-
56-
jest.mock( '@wordpress/primitives', () => ( {
57-
SVG: ( { children, ...props } ) => <svg { ...props }>{ children }</svg>,
58-
Path: ( props ) => <path { ...props } />,
59-
} ) );
60-
61-
jest.mock( '../../../../utils/countryInfoLinks', () => ( {
62-
learnMoreLinks: {
63-
US: { PayWithPayPal: 'https://example.com' },
64-
GB: { PayWithPayPal: 'https://example.com' },
65-
AU: { PayWithPayPal: 'https://example.com' },
66-
MX: { PayWithPayPal: 'https://example.com' },
67-
},
68-
} ) );
69-
709
const EXPECTED_PAYMENT_METHODS = [
7110
[
7211
'US',

0 commit comments

Comments
 (0)