@@ -65,6 +65,7 @@ sentryTest('captures a "GOOD" CLS vital with its source as a standalone span', a
65
65
'sentry.exclusive_time' : 0 ,
66
66
'sentry.op' : 'ui.webvital.cls' ,
67
67
'sentry.origin' : 'auto.http.browser.cls' ,
68
+ 'sentry.report_event' : 'pagehide' ,
68
69
transaction : expect . stringContaining ( 'index.html' ) ,
69
70
'user_agent.original' : expect . stringContaining ( 'Chrome' ) ,
70
71
'sentry.pageload.span_id' : expect . stringMatching ( / [ a - f 0 - 9 ] { 16 } / ) ,
@@ -134,6 +135,7 @@ sentryTest('captures a "MEH" CLS vital with its source as a standalone span', as
134
135
'sentry.exclusive_time' : 0 ,
135
136
'sentry.op' : 'ui.webvital.cls' ,
136
137
'sentry.origin' : 'auto.http.browser.cls' ,
138
+ 'sentry.report_event' : 'pagehide' ,
137
139
transaction : expect . stringContaining ( 'index.html' ) ,
138
140
'user_agent.original' : expect . stringContaining ( 'Chrome' ) ,
139
141
'sentry.pageload.span_id' : expect . stringMatching ( / [ a - f 0 - 9 ] { 16 } / ) ,
@@ -201,6 +203,7 @@ sentryTest('captures a "POOR" CLS vital with its source as a standalone span.',
201
203
'sentry.exclusive_time' : 0 ,
202
204
'sentry.op' : 'ui.webvital.cls' ,
203
205
'sentry.origin' : 'auto.http.browser.cls' ,
206
+ 'sentry.report_event' : 'pagehide' ,
204
207
transaction : expect . stringContaining ( 'index.html' ) ,
205
208
'user_agent.original' : expect . stringContaining ( 'Chrome' ) ,
206
209
'sentry.pageload.span_id' : expect . stringMatching ( / [ a - f 0 - 9 ] { 16 } / ) ,
@@ -269,6 +272,7 @@ sentryTest(
269
272
'sentry.exclusive_time' : 0 ,
270
273
'sentry.op' : 'ui.webvital.cls' ,
271
274
'sentry.origin' : 'auto.http.browser.cls' ,
275
+ 'sentry.report_event' : 'pagehide' ,
272
276
transaction : expect . stringContaining ( 'index.html' ) ,
273
277
'user_agent.original' : expect . stringContaining ( 'Chrome' ) ,
274
278
'sentry.pageload.span_id' : expect . stringMatching ( / [ a - f 0 - 9 ] { 16 } / ) ,
@@ -342,6 +346,8 @@ sentryTest(
342
346
// Ensure the CLS span is connected to the pageload span and trace
343
347
expect ( spanEnvelopeItem . data ?. [ 'sentry.pageload.span_id' ] ) . toBe ( pageloadSpanId ) ;
344
348
expect ( spanEnvelopeItem . trace_id ) . toEqual ( pageloadTraceId ) ;
349
+
350
+ expect ( spanEnvelopeItem . data ?. [ 'sentry.report_event' ] ) . toBe ( 'pagehide' ) ;
345
351
} ,
346
352
) ;
347
353
@@ -374,6 +380,8 @@ sentryTest('sends CLS of the initial page when soft-navigating to a new page', a
374
380
expect ( spanEnvelopeItem . measurements ?. cls ?. value ) . toBeLessThan ( 0.15 ) ;
375
381
expect ( spanEnvelopeItem . data ?. [ 'sentry.pageload.span_id' ] ) . toBe ( pageloadEventData . contexts ?. trace ?. span_id ) ;
376
382
expect ( spanEnvelopeItem . trace_id ) . toEqual ( pageloadTraceId ) ;
383
+
384
+ expect ( spanEnvelopeItem . data ?. [ 'sentry.report_event' ] ) . toBe ( 'navigation' ) ;
377
385
} ) ;
378
386
379
387
sentryTest ( "doesn't send further CLS after the first navigation" , async ( { getLocalTestUrl, page } ) => {
@@ -398,6 +406,7 @@ sentryTest("doesn't send further CLS after the first navigation", async ({ getLo
398
406
const spanEnvelope = ( await spanEnvelopePromise ) [ 0 ] ;
399
407
const spanEnvelopeItem = spanEnvelope [ 1 ] [ 0 ] [ 1 ] ;
400
408
expect ( spanEnvelopeItem . measurements ?. cls ?. value ) . toBeGreaterThan ( 0 ) ;
409
+ expect ( spanEnvelopeItem . data ?. [ 'sentry.report_event' ] ) . toBe ( 'navigation' ) ;
401
410
402
411
getMultipleSentryEnvelopeRequests < SpanEnvelope > ( page , 1 , { envelopeType : 'span' } , ( ) => {
403
412
throw new Error ( 'Unexpected span - This should not happen!' ) ;
@@ -442,6 +451,7 @@ sentryTest("doesn't send further CLS after the first page hide", async ({ getLoc
442
451
const spanEnvelope = ( await spanEnvelopePromise ) [ 0 ] ;
443
452
const spanEnvelopeItem = spanEnvelope [ 1 ] [ 0 ] [ 1 ] ;
444
453
expect ( spanEnvelopeItem . measurements ?. cls ?. value ) . toBeGreaterThan ( 0 ) ;
454
+ expect ( spanEnvelopeItem . data ?. [ 'sentry.report_event' ] ) . toBe ( 'pagehide' ) ;
445
455
446
456
getMultipleSentryEnvelopeRequests < SpanEnvelope > ( page , 1 , { envelopeType : 'span' } , ( ) => {
447
457
throw new Error ( 'Unexpected span - This should not happen!' ) ;
0 commit comments