LFFE-14 Testing config

This commit is contained in:
AmirHossein Mahmoodi
2023-11-05 11:21:03 +03:30
parent e940b235e8
commit 46d6dc6bb6
12 changed files with 256 additions and 2 deletions

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 = ({children, locale, title, isBot}) => {
const pageProps = {
title: title || '', isBot: isBot || true, locale: locale || 'fa', messages: translations[locale || 'fa']
}
return (<App Component={() => (<>{children}</>)} pageProps={pageProps}/>)
}
export default MockAppWithProviders

1
mocks/handler.js Normal file
View File

@@ -0,0 +1 @@
export const handler = [];

4
mocks/server.js Normal file
View File

@@ -0,0 +1,4 @@
import {setupServer} from "msw/node";
import {handler} from "./handler";
export const server = setupServer(...handler)