Skip to content

Commit d32283d

Browse files
authored
chore: Add tests for ingest dsn (getsentry#2536)
1 parent fd68dfa commit d32283d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

packages/core/test/lib/api.test.ts

+6
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { Dsn } from '@sentry/utils';
22

33
import { API } from '../../src/api';
44

5+
const ingestDsn = 'https://abc@xxxx.ingest.sentry.io:1234/subpath/123';
56
const dsnPublic = 'https://abc@sentry.io:1234/subpath/123';
67
const legacyDsn = 'https://abc:123@sentry.io:1234/subpath/123';
78

@@ -11,6 +12,7 @@ describe('API', () => {
1112
'https://sentry.io:1234/subpath/api/123/store/?sentry_key=abc&sentry_version=7',
1213
);
1314
expect(new API(dsnPublic).getStoreEndpoint()).toEqual('https://sentry.io:1234/subpath/api/123/store/');
15+
expect(new API(ingestDsn).getStoreEndpoint()).toEqual('https://xxxx.ingest.sentry.io:1234/subpath/api/123/store/');
1416
});
1517

1618
test('getRequestHeaders', () => {
@@ -28,6 +30,10 @@ describe('API', () => {
2830
});
2931

3032
test('getReportDialogEndpoint', () => {
33+
expect(new API(ingestDsn).getReportDialogEndpoint({})).toEqual(
34+
'https://xxxx.ingest.sentry.io:1234/subpath/api/embed/error-page/?dsn=https://abc@xxxx.ingest.sentry.io:1234/subpath/123',
35+
);
36+
3137
expect(new API(dsnPublic).getReportDialogEndpoint({})).toEqual(
3238
'https://sentry.io:1234/subpath/api/embed/error-page/?dsn=https://abc@sentry.io:1234/subpath/123',
3339
);

0 commit comments

Comments
 (0)