Skip to content

Commit fe0660b

Browse files
committed
Update e2e tests.
1 parent bcb1cc7 commit fe0660b

File tree

3 files changed

+19
-14
lines changed

3 files changed

+19
-14
lines changed

dev-packages/e2e-tests/test-applications/react-router-6-descendant-routes/src/index.tsx

+15-10
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import React from 'react';
33
import ReactDOM from 'react-dom/client';
44
import {
55
BrowserRouter,
6-
Outlet,
76
Route,
87
Routes,
98
createRoutesFromChildren,
@@ -43,16 +42,22 @@ Sentry.init({
4342

4443
const SentryRoutes = Sentry.withSentryReactRouterV6Routing(Routes);
4544

45+
const DetailsRoutes = () => (
46+
<SentryRoutes>
47+
<Route path=":detailId" element={<div id="details">Details</div>} />
48+
</SentryRoutes>
49+
);
50+
51+
const ViewsRoutes = () => (
52+
<SentryRoutes>
53+
<Route index element={<div id="views">Views</div>} />
54+
<Route path="views/:viewId/*" element={<DetailsRoutes />} />
55+
</SentryRoutes>
56+
);
57+
4658
const ProjectsRoutes = () => (
4759
<SentryRoutes>
48-
<Route path=":projectId" element={<div>Project Page</div>}>
49-
<Route index element={<div>Project Page Root</div>} />
50-
<Route element={<div>Editor</div>}>
51-
<Route path="*" element={<Outlet />}>
52-
<Route path="views/:viewId" element={<div>View Canvas</div>} />
53-
</Route>
54-
</Route>
55-
</Route>
60+
<Route path="projects/:projectId/*" element={<ViewsRoutes />}></Route>
5661
<Route path="*" element={<div>No Match Page</div>} />
5762
</SentryRoutes>
5863
);
@@ -62,7 +67,7 @@ root.render(
6267
<BrowserRouter>
6368
<SentryRoutes>
6469
<Route path="/" element={<Index />} />
65-
<Route path="projects/*" element={<ProjectsRoutes />}></Route>
70+
<Route path="/*" element={<ProjectsRoutes />}></Route>
6671
</SentryRoutes>
6772
</BrowserRouter>,
6873
);

dev-packages/e2e-tests/test-applications/react-router-6-descendant-routes/src/pages/Index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { Link } from 'react-router-dom';
55
const Index = () => {
66
return (
77
<>
8-
<Link to="/projects/123/views/456" id="navigation">
8+
<Link to="/projects/123/views/456/789" id="navigation">
99
navigate
1010
</Link>
1111
</>

dev-packages/e2e-tests/test-applications/react-router-6-descendant-routes/tests/transactions.test.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ test('sends a pageload transaction with a parameterized URL', async ({ page }) =
66
return !!transactionEvent?.transaction && transactionEvent.contexts?.trace?.op === 'pageload';
77
});
88

9-
await page.goto(`/projects/123/views/234`);
9+
await page.goto(`/projects/123/views/234/567`);
1010

1111
const rootSpan = await transactionPromise;
1212

@@ -17,7 +17,7 @@ test('sends a pageload transaction with a parameterized URL', async ({ page }) =
1717
origin: 'auto.pageload.react.reactrouter_v6',
1818
},
1919
},
20-
transaction: '/projects/:projectId/views/:viewId',
20+
transaction: '/projects/:projectId/views/:viewId/:detailId',
2121
transaction_info: {
2222
source: 'route',
2323
},
@@ -59,7 +59,7 @@ test('sends a navigation transaction with a parameterized URL', async ({ page })
5959
origin: 'auto.navigation.react.reactrouter_v6',
6060
},
6161
},
62-
transaction: '/projects/:projectId/views/:viewId',
62+
transaction: '/projects/:projectId/views/:viewId/:detailId',
6363
transaction_info: {
6464
source: 'route',
6565
},

0 commit comments

Comments
 (0)