Initial commit

This commit is contained in:
forceoranj
2021-10-16 01:53:56 +02:00
commit ebdd8dccdd
104 changed files with 29770 additions and 0 deletions

16
src/utils/mockStore.tsx Normal file
View File

@@ -0,0 +1,16 @@
import { ReactNode } from "react"
import { Provider } from "react-redux"
import thunk from "redux-thunk"
import configurecreateMockStore from "redux-mock-store"
export default (obj = {}): Record<string, any> => {
const store = configurecreateMockStore([thunk])(obj)
const originalDispatch = store.dispatch
store.dispatch = jest.fn(originalDispatch)
const ProviderWithStore = ({ children }: { children: ReactNode }) => (
<Provider store={store}>{children}</Provider>
)
return { ...store, ProviderWithStore }
}