11import { expect } from '@playwright/test' ;
2- import type { Event } from '@sentry/types' ;
2+ import type { SerializedEvent } from '@sentry/types' ;
33
44import { sentryTest } from '../../../../utils/fixtures' ;
55import { getFirstSentryEnvelopeRequest , shouldSkipTracingTest } from '../../../../utils/helpers' ;
@@ -10,7 +10,7 @@ sentryTest('should report a transaction in an envelope', async ({ getLocalTestPa
1010 }
1111
1212 const url = await getLocalTestPath ( { testDir : __dirname } ) ;
13- const transaction = await getFirstSentryEnvelopeRequest < Event > ( page , url ) ;
13+ const transaction = await getFirstSentryEnvelopeRequest < SerializedEvent > ( page , url ) ;
1414
1515 expect ( transaction . transaction ) . toBe ( 'test_transaction_1' ) ;
1616 expect ( transaction . spans ) . toBeDefined ( ) ;
@@ -22,30 +22,23 @@ sentryTest('should report finished spans as children of the root transaction', a
2222 }
2323
2424 const url = await getLocalTestPath ( { testDir : __dirname } ) ;
25- const transaction = await getFirstSentryEnvelopeRequest < Event > ( page , url ) ;
25+ const transaction = await getFirstSentryEnvelopeRequest < SerializedEvent > ( page , url ) ;
2626
2727 const rootSpanId = transaction ?. contexts ?. trace ?. span_id ;
2828
2929 expect ( transaction . spans ) . toHaveLength ( 3 ) ;
3030
3131 const span_1 = transaction . spans ?. [ 0 ] ;
3232
33- // eslint-disable-next-line deprecation/deprecation
3433 expect ( span_1 ?. op ) . toBe ( 'span_1' ) ;
35- // @ts -expect-error this property is not defined on the incorrectly used Event
3634 expect ( span_1 ?. parent_span_id ) . toEqual ( rootSpanId ) ;
37- // eslint-disable-next-line deprecation/deprecation
3835 expect ( span_1 ?. data ) . toMatchObject ( { foo : 'bar' , baz : [ 1 , 2 , 3 ] } ) ;
3936
4037 const span_3 = transaction . spans ?. [ 1 ] ;
41- // eslint-disable-next-line deprecation/deprecation
4238 expect ( span_3 ?. op ) . toBe ( 'span_3' ) ;
43- // @ts -expect-error this property is not defined on the incorrectly used Event
4439 expect ( span_3 ?. parent_span_id ) . toEqual ( rootSpanId ) ;
4540
4641 const span_5 = transaction . spans ?. [ 2 ] ;
47- // eslint-disable-next-line deprecation/deprecation
4842 expect ( span_5 ?. op ) . toBe ( 'span_5' ) ;
49- // @ts -expect-error this property is not defined on the incorrectly used Event
5043 expect ( span_5 ?. parent_span_id ) . toEqual ( span_3 ?. span_id ) ;
5144} ) ;
0 commit comments