CFE-10 create mock _app with providers
This commit is contained in:
13
mocks/AppWithProvider.jsx
Normal file
13
mocks/AppWithProvider.jsx
Normal file
@@ -0,0 +1,13 @@
|
||||
import App from "@/pages/_app";
|
||||
import fa from "&/locales/fa/app.json"
|
||||
|
||||
const translations = {fa};
|
||||
const MockAppWithProviders = ({Component, locale, title, isBot}) => {
|
||||
const pageProps = {
|
||||
title: title || '', isBot: isBot || true, locale: locale || 'fa', messages: translations[locale || 'fa']
|
||||
}
|
||||
|
||||
return (<App Component={Component} pageProps={pageProps}/>)
|
||||
}
|
||||
|
||||
export default MockAppWithProviders
|
||||
Reference in New Issue
Block a user