Skip to content

Commit b176f1d

Browse files
committed
add integration test for empty string attribute
1 parent 16b21ce commit b176f1d

File tree

2 files changed

+32
-0
lines changed
  • dev-packages/browser-integration-tests/suites/public-api/startSpan/attributes

2 files changed

+32
-0
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
async function run() {
2+
Sentry.startSpan({ name: 'parent_span' }, () => {
3+
Sentry.startSpan({ name: 'child_span', attributes: { someAttribute: '' } }, () => {
4+
// whatever a user would do here
5+
});
6+
});
7+
}
8+
9+
(async () => {
10+
await run();
11+
})();
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import { expect } from '@playwright/test';
2+
3+
import { sentryTest } from '../../../../utils/fixtures';
4+
import {
5+
envelopeRequestParser,
6+
shouldSkipTracingTest,
7+
waitForTransactionRequestOnUrl,
8+
} from '../../../../utils/helpers';
9+
10+
sentryTest('sends an empty string attribute', async ({ getLocalTestPath, page }) => {
11+
if (shouldSkipTracingTest()) {
12+
sentryTest.skip();
13+
}
14+
15+
const url = await getLocalTestPath({ testDir: __dirname });
16+
const req = await waitForTransactionRequestOnUrl(page, url);
17+
const transaction = envelopeRequestParser(req);
18+
19+
const childSpan = transaction.spans?.[0];
20+
expect(childSpan?.data?.someAttribute).toBe('');
21+
});

0 commit comments

Comments
 (0)