File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed
dev-packages/e2e-tests/test-applications/tanstackstart-react/tests Expand file tree Collapse file tree 1 file changed +20
-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+ test ( 'Sends a server function transaction' , async ( { page } ) => {
5+ const transactionEventPromise = waitForTransaction ( 'tanstackstart-react' , transactionEvent => {
6+ return transactionEvent ?. contexts ?. trace ?. op === 'http.server' && transactionEvent ?. transaction === 'GET /' ;
7+ } ) ;
8+
9+ await page . goto ( '/' ) ;
10+
11+ await expect ( page . locator ( 'button' ) . filter ( { hasText : 'Break server function' } ) ) . toBeVisible ( ) ;
12+
13+ await page . locator ( 'button' ) . filter ( { hasText : 'Break server function' } ) . click ( ) ;
14+
15+ const transactionEvent = await transactionEventPromise ;
16+
17+ // TODO: verify correct span data
18+ expect ( Array . isArray ( transactionEvent ?. spans ) ) . toBe ( true ) ;
19+ expect ( transactionEvent ?. spans ?. length ) . toBeGreaterThan ( 0 ) ;
20+ } ) ;
You can’t perform that action at this time.
0 commit comments