Skip to content

Commit 320aa98

Browse files
committed
add basic failing transaction test
1 parent a3f5e05 commit 320aa98

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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+
});

0 commit comments

Comments
 (0)