Skip to content

Commit 586129a

Browse files
committed
Update e2e tests.
1 parent bcb1cc7 commit 586129a

File tree

3 files changed

+20
-13
lines changed

3 files changed

+20
-13
lines changed

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

+16-9
Original file line numberDiff line numberDiff line change
@@ -43,16 +43,23 @@ Sentry.init({
4343

4444
const SentryRoutes = Sentry.withSentryReactRouterV6Routing(Routes);
4545

46+
47+
const DetailsRoutes = () => (
48+
<SentryRoutes>
49+
<Route path=":detailId" element={<div id="details">Details</div>} />
50+
</SentryRoutes>
51+
);
52+
53+
const ViewsRoutes = () => (
54+
<SentryRoutes>
55+
<Route index element={<div id="views">Views</div>} />
56+
<Route path="views/:viewId/*" element={<DetailsRoutes />} />
57+
</SentryRoutes>
58+
);
59+
4660
const ProjectsRoutes = () => (
4761
<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>
62+
<Route path="projects/:projectId/*" element={<ViewsRoutes />}></Route>
5663
<Route path="*" element={<div>No Match Page</div>} />
5764
</SentryRoutes>
5865
);
@@ -62,7 +69,7 @@ root.render(
6269
<BrowserRouter>
6370
<SentryRoutes>
6471
<Route path="/" element={<Index />} />
65-
<Route path="projects/*" element={<ProjectsRoutes />}></Route>
72+
<Route path="/*" element={<ProjectsRoutes />}></Route>
6673
</SentryRoutes>
6774
</BrowserRouter>,
6875
);

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)