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',
17 let routeHistory = createMemoryHistory({ initialEntries: ['/inbox'] });
18 const MAIL_MAIN_ROUTE_PATH = '/:labelID?/:elementID?/:messageID?';
20 export const OffersTestProvider = ({
22 config = DEFAULT_CONFIG,
24 children: React.ReactNode;
25 config?: ProtonConfig;
27 <ConfigProvider config={config}>
28 <Router history={routeHistory}>
29 <Route path={MAIL_MAIN_ROUTE_PATH}>{children}</Route>