Skip to content

Commit 314b615

Browse files
Add integration test
1 parent 1407448 commit 314b615

File tree

3 files changed

+31
-0
lines changed

3 files changed

+31
-0
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import * as Sentry from '@sentry/browser';
2+
3+
window.Sentry = Sentry;
4+
5+
Sentry.init({
6+
dsn: 'https://[email protected]/1337',
7+
});
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Sentry.captureUserFeedback({
2+
eventId: 'test_event_id',
3+
email: 'test_email',
4+
comments: 'test_comments',
5+
name: 'test_name',
6+
});
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { expect } from '@playwright/test';
2+
import type { UserFeedback } from '@sentry/types';
3+
4+
import { sentryTest } from '../../../../utils/fixtures';
5+
import { getFirstSentryEnvelopeRequest } from '../../../../utils/helpers';
6+
7+
sentryTest('should capture simple user feedback', async ({ getLocalTestPath, page }) => {
8+
const url = await getLocalTestPath({ testDir: __dirname });
9+
10+
const eventData = await getFirstSentryEnvelopeRequest<UserFeedback>(page, url);
11+
12+
expect(eventData).toMatchObject({
13+
eventId: 'test_event_id',
14+
email: 'test_email',
15+
comments: 'test_comments',
16+
name: 'test_name',
17+
});
18+
});

0 commit comments

Comments
 (0)