From fe6000f5b30c10256a9b00e2572c53cfaa03f6b9 Mon Sep 17 00:00:00 2001 From: make-github-pseudonymous-again <5165674+make-github-pseudonymous-again@users.noreply.github.com> Date: Tue, 10 Dec 2024 14:35:10 +0100 Subject: [PATCH] :woman_technologist: dx(tests): Experiment with test-only routes. --- imports/ui/App.tsx | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/imports/ui/App.tsx b/imports/ui/App.tsx index 9517451e8..063198083 100644 --- a/imports/ui/App.tsx +++ b/imports/ui/App.tsx @@ -1,6 +1,6 @@ import React from 'react'; -import {BrowserRouter} from 'react-router-dom'; +import {BrowserRouter, Routes, Route} from 'react-router-dom'; import {CacheProvider} from '@emotion/react'; import createCache from '@emotion/cache'; @@ -10,6 +10,8 @@ import {SnackbarProvider} from 'notistack'; import CssBaseline from '@mui/material/CssBaseline'; +import isTest from '../app/isTest'; + import DateTimeLocalizationProvider from './i18n/DateTimeLocalizationProvider'; import CustomWholeWindowDropZone from './input/CustomWholeWindowDropZone'; import ModalProvider from './modal/ModelProvider'; @@ -24,11 +26,22 @@ export const muiCache = createCache({ prepend: true, }); +const Router = isTest() + ? ({children}) => ( + + + test} path="/_test" /> + + + + ) + : BrowserRouter; + const App = () => { const theme = useUserTheme(); return ( - + @@ -47,7 +60,7 @@ const App = () => { - + ); };