File tree Expand file tree Collapse file tree 1 file changed +38
-0
lines changed
dev-packages/e2e-tests/test-applications/tanstackstart-react/tests Expand file tree Collapse file tree 1 file changed +38
-0
lines changed Original file line number Diff line number Diff line change 1+ import { expect , test } from '@playwright/test' ;
2+ import { waitForTransaction } from '@sentry-internal/test-utils' ;
3+
4+ // we have more thorough tests for tanstack-router in a separate e2e test
5+ // so here we just do a basic check to verify that the integration is automatically enabled if tracing is enabled
6+ test ( 'sends a pageload transaction' , async ( { page } ) => {
7+ const transactionPromise = waitForTransaction ( 'tanstackstart-react' , async transactionEvent => {
8+ console . log ( 'transactionEvent' , transactionEvent ) ;
9+ return ! ! transactionEvent ?. transaction && transactionEvent . contexts ?. trace ?. op === 'pageload' ;
10+ } ) ;
11+
12+ await page . goto ( `/` ) ;
13+
14+ const rootSpan = await transactionPromise ;
15+
16+ expect ( rootSpan ) . toMatchObject ( {
17+ contexts : {
18+ trace : {
19+ data : {
20+ 'sentry.source' : 'route' ,
21+ 'sentry.origin' : 'auto.pageload.react.tanstackstart_react' ,
22+ 'sentry.op' : 'pageload' ,
23+ } ,
24+ op : 'pageload' ,
25+ origin : 'auto.pageload.react.tanstackstart_react' ,
26+ } ,
27+ } ,
28+ transaction : '/' ,
29+ transaction_info : {
30+ source : 'route' ,
31+ } ,
32+ spans : expect . arrayContaining ( [
33+ expect . objectContaining ( {
34+ description : 'loading-home' ,
35+ } ) ,
36+ ] ) ,
37+ } ) ;
38+ } ) ;
You can’t perform that action at this time.
0 commit comments