mirror of
https://github.com/elyby/accounts-frontend.git
synced 2025-05-31 14:11:58 +05:30
Fix all tests and replace enzyme with @testing-library/react
This commit is contained in:
18
packages/app/shell/TestContextProvider.tsx
Normal file
18
packages/app/shell/TestContextProvider.tsx
Normal file
@@ -0,0 +1,18 @@
|
||||
import React from 'react';
|
||||
import { createMemoryHistory } from 'history';
|
||||
import storeFactory from 'app/storeFactory';
|
||||
|
||||
import ContextProvider from './ContextProvider';
|
||||
|
||||
type ContextProps = React.ComponentProps<typeof ContextProvider>;
|
||||
|
||||
function TestContextProvider(
|
||||
props: Partial<ContextProps> & { children: ContextProps['children'] },
|
||||
) {
|
||||
const store = React.useMemo(storeFactory, []);
|
||||
const history = React.useMemo(createMemoryHistory, []);
|
||||
|
||||
return <ContextProvider store={store} history={history} {...props} />;
|
||||
}
|
||||
|
||||
export default TestContextProvider;
|
@@ -1 +0,0 @@
|
||||
export { default as ContextProvider } from './ContextProvider';
|
2
packages/app/shell/index.tsx
Normal file
2
packages/app/shell/index.tsx
Normal file
@@ -0,0 +1,2 @@
|
||||
export { default as ContextProvider } from './ContextProvider';
|
||||
export { default as TestContextProvider } from './TestContextProvider';
|
Reference in New Issue
Block a user