-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Expand file tree
/
Copy pathtest.ts
More file actions
27 lines (20 loc) · 889 Bytes
/
test.ts
File metadata and controls
27 lines (20 loc) · 889 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import { expect } from '@playwright/test';
import type { Event } from '@sentry/core';
import { sentryTest } from '../../../../utils/fixtures';
import { getMultipleSentryEnvelopeRequests } from '../../../../utils/helpers';
sentryTest('should unset user', async ({ getLocalTestUrl, page }) => {
const url = await getLocalTestUrl({ testDir: __dirname });
const eventData = await getMultipleSentryEnvelopeRequests<Event>(page, 3, { url });
expect(eventData[0].message).toBe('no_user');
// because sendDefaultPii: true
expect(eventData[0].sdk?.settings?.infer_ip).toBe('auto');
expect(eventData[1].message).toBe('user');
expect(eventData[1].user).toEqual({
id: 'foo',
ip_address: 'bar',
other_key: 'baz',
});
expect(eventData[2].message).toBe('unset_user');
// because sendDefaultPii: true
expect(eventData[2].sdk?.settings?.infer_ip).toBe('auto');
});