Skip to content

Commit cd33838

Browse files
committed
test(astro-5): Add test for current parametrized routes (#17054)
Adds a test case with a client, server and server API request which checks: - that everything is correctly connected - that everything has parametrized routes (the current state of it - some are not yet parametrized) This is a visual representation of the test case (with a different param): <img width="502" height="197" alt="image" src="https://github.com/user-attachments/assets/e1a14c2b-2547-427b-964b-5c8fb6db49a2" /> Part of #16686
1 parent 7cd1c2d commit cd33838

File tree

1 file changed

+1
-50
lines changed

1 file changed

+1
-50
lines changed

dev-packages/e2e-tests/test-applications/astro-5/tests/tracing.dynamic.test.ts

Lines changed: 1 addition & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ test.describe('nested SSR routes (client, server, server request)', () => {
233233
expect(serverRequestHTTPClientSpan).toMatchObject({
234234
op: 'http.client',
235235
origin: 'auto.http.otel.node_fetch',
236-
description: 'GET http://localhost:3030/api/user/myUsername123.json', // http.client does not need to be parametrized
236+
description: 'GET http://localhost:3030/api/user/myUsername123.json', // todo: parametrize (this is just a span though - no transaction)
237237
data: {
238238
'sentry.op': 'http.client',
239239
'sentry.origin': 'auto.http.otel.node_fetch',
@@ -262,53 +262,4 @@ test.describe('nested SSR routes (client, server, server request)', () => {
262262
request: { url: expect.stringContaining('/api/user/myUsername123.json') },
263263
});
264264
});
265-
266-
test('sends parametrized pageload and server transaction names for catch-all routes', async ({ page }) => {
267-
const clientPageloadTxnPromise = waitForTransaction('astro-5', txnEvent => {
268-
return txnEvent?.transaction?.startsWith('/catchAll/') ?? false;
269-
});
270-
271-
const serverPageRequestTxnPromise = waitForTransaction('astro-5', txnEvent => {
272-
return txnEvent?.transaction?.startsWith('GET /catchAll/') ?? false;
273-
});
274-
275-
await page.goto('/catchAll/hell0/whatever-do');
276-
277-
const clientPageloadTxn = await clientPageloadTxnPromise;
278-
const serverPageRequestTxn = await serverPageRequestTxnPromise;
279-
280-
expect(clientPageloadTxn).toMatchObject({
281-
transaction: '/catchAll/hell0/whatever-do', // todo: parametrize to '/catchAll/[...path]'
282-
transaction_info: { source: 'url' },
283-
contexts: {
284-
trace: {
285-
op: 'pageload',
286-
origin: 'auto.pageload.browser',
287-
data: {
288-
'sentry.op': 'pageload',
289-
'sentry.origin': 'auto.pageload.browser',
290-
'sentry.source': 'url',
291-
},
292-
},
293-
},
294-
});
295-
296-
expect(serverPageRequestTxn).toMatchObject({
297-
transaction: 'GET /catchAll/[path]',
298-
transaction_info: { source: 'route' },
299-
contexts: {
300-
trace: {
301-
op: 'http.server',
302-
origin: 'auto.http.astro',
303-
data: {
304-
'sentry.op': 'http.server',
305-
'sentry.origin': 'auto.http.astro',
306-
'sentry.source': 'route',
307-
url: expect.stringContaining('/catchAll/hell0/whatever-do'),
308-
},
309-
},
310-
},
311-
request: { url: expect.stringContaining('/catchAll/hell0/whatever-do') },
312-
});
313-
});
314265
});

0 commit comments

Comments
 (0)