Fix all tests and replace enzyme with @testing-library/react

This commit is contained in:
SleepWalker
2020-05-21 21:08:47 +03:00
parent a0ec9574e2
commit e1f15b5d22
20 changed files with 430 additions and 600 deletions

View 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;

View File

@@ -1 +0,0 @@
export { default as ContextProvider } from './ContextProvider';

View File

@@ -0,0 +1,2 @@
export { default as ContextProvider } from './ContextProvider';
export { default as TestContextProvider } from './TestContextProvider';