@@ -69,30 +69,30 @@ test.describe('distributed tracing', () => {
69
69
70
70
test ( 'capture a distributed trace from a client-side API request with parametrized routes' , async ( { page } ) => {
71
71
const clientTxnEventPromise = waitForTransaction ( 'nuxt-4' , txnEvent => {
72
- return txnEvent . transaction === '/test-param/fetch-api/:param ()' ;
72
+ return txnEvent . transaction === '/test-param/user/:userId ()' ;
73
73
} ) ;
74
74
const ssrTxnEventPromise = waitForTransaction ( 'nuxt-4' , txnEvent => {
75
- return txnEvent . transaction ?. includes ( 'GET /test-param/fetch-api ' ) ?? false ;
75
+ return txnEvent . transaction ?. includes ( 'GET /test-param/user ' ) ?? false ;
76
76
} ) ;
77
77
const serverReqTxnEventPromise = waitForTransaction ( 'nuxt-4' , txnEvent => {
78
- return txnEvent . transaction ?. includes ( 'GET /api/test-param /' ) ?? false ;
78
+ return txnEvent . transaction ?. includes ( 'GET /api/user /' ) ?? false ;
79
79
} ) ;
80
80
81
81
// Navigate to the page which will trigger an API call from the client-side
82
- await page . goto ( `/test-param/fetch-api /${ PARAM } ` ) ;
82
+ await page . goto ( `/test-param/user /${ PARAM } ` ) ;
83
83
84
84
const [ clientTxnEvent , ssrTxnEvent , serverReqTxnEvent ] = await Promise . all ( [
85
85
clientTxnEventPromise ,
86
86
ssrTxnEventPromise ,
87
87
serverReqTxnEventPromise ,
88
88
] ) ;
89
89
90
- const httpClientSpan = clientTxnEvent ?. spans ?. find ( span => span . description === `GET /api/test-param /${ PARAM } ` ) ;
90
+ const httpClientSpan = clientTxnEvent ?. spans ?. find ( span => span . description === `GET /api/user /${ PARAM } ` ) ;
91
91
92
92
expect ( clientTxnEvent ) . toEqual (
93
93
expect . objectContaining ( {
94
94
type : 'transaction' ,
95
- transaction : '/test-param/fetch-api/:param ()' , // parametrized route
95
+ transaction : '/test-param/user/:userId ()' , // parametrized route
96
96
transaction_info : { source : 'route' } ,
97
97
contexts : expect . objectContaining ( {
98
98
trace : expect . objectContaining ( {
@@ -106,10 +106,10 @@ test.describe('distributed tracing', () => {
106
106
expect ( httpClientSpan ) . toBeDefined ( ) ;
107
107
expect ( httpClientSpan ) . toEqual (
108
108
expect . objectContaining ( {
109
- description : `GET /api/test-param /${ PARAM } ` , // fixme: parametrize
109
+ description : `GET /api/user /${ PARAM } ` , // fixme: parametrize
110
110
parent_span_id : clientTxnEvent . contexts ?. trace ?. span_id , // pageload span is parent
111
111
data : expect . objectContaining ( {
112
- url : `/api/test-param /${ PARAM } ` , // fixme: parametrize
112
+ url : `/api/user /${ PARAM } ` ,
113
113
type : 'fetch' ,
114
114
'sentry.op' : 'http.client' ,
115
115
'sentry.origin' : 'auto.http.browser' ,
@@ -121,7 +121,7 @@ test.describe('distributed tracing', () => {
121
121
expect ( ssrTxnEvent ) . toEqual (
122
122
expect . objectContaining ( {
123
123
type : 'transaction' ,
124
- transaction : `GET /test-param/fetch-api /${ PARAM } ` , // fixme: parametrize (nitro)
124
+ transaction : `GET /test-param/user /${ PARAM } ` , // fixme: parametrize (nitro)
125
125
transaction_info : { source : 'url' } ,
126
126
contexts : expect . objectContaining ( {
127
127
trace : expect . objectContaining ( {
@@ -135,7 +135,7 @@ test.describe('distributed tracing', () => {
135
135
expect ( serverReqTxnEvent ) . toEqual (
136
136
expect . objectContaining ( {
137
137
type : 'transaction' ,
138
- transaction : `GET /api/test-param /${ PARAM } ` ,
138
+ transaction : `GET /api/user /${ PARAM } ` ,
139
139
transaction_info : { source : 'url' } ,
140
140
contexts : expect . objectContaining ( {
141
141
trace : expect . objectContaining ( {
0 commit comments