CFE-10 create mock _app with providers

This commit is contained in:
AmirHossein Mahmoodi
2023-09-25 11:26:55 +03:30
parent f88542406f
commit 9a60b215df

13
mocks/AppWithProvider.jsx Normal file
View 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