Remove payments API routing initialization
[ProtonMail-WebClient.git] / packages / components / containers / offers / Offers.test.helpers.tsx
blob69455aae6a5b826893c7c61dd4b2eb4941f30b7c
1 import React from 'react';
2 import { Route, Router } from 'react-router';
4 import { createMemoryHistory } from 'history';
6 import { APPS } from '@proton/shared/lib/constants';
7 import type { ProtonConfig } from '@proton/shared/lib/interfaces';
9 import ConfigProvider from '../config/Provider';
11 export const DEFAULT_CONFIG = {
12     APP_NAME: APPS.PROTONMAIL,
13     APP_VERSION: 'test-version',
14     DATE_VERSION: 'test-date-version',
15 } as ProtonConfig;
17 let routeHistory = createMemoryHistory({ initialEntries: ['/inbox'] });
18 const MAIL_MAIN_ROUTE_PATH = '/:labelID?/:elementID?/:messageID?';
20 export const OffersTestProvider = ({
21     children,
22     config = DEFAULT_CONFIG,
23 }: {
24     children: React.ReactNode;
25     config?: ProtonConfig;
26 }) => (
27     <ConfigProvider config={config}>
28         <Router history={routeHistory}>
29             <Route path={MAIL_MAIN_ROUTE_PATH}>{children}</Route>
30         </Router>
31     </ConfigProvider>