Skip to content

Commit c367c83

Browse files
committed
lint
1 parent 117e9f2 commit c367c83

File tree

3 files changed

+73
-67
lines changed

3 files changed

+73
-67
lines changed

packages/integration-tests/suites/replay/privacyInput/test.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { expect } from '@playwright/test';
22
import { IncrementalSource } from '@sentry-internal/rrweb';
3-
import type { incrementalData, inputData} from '@sentry-internal/rrweb/typings/types';
3+
import type { incrementalData, inputData } from '@sentry-internal/rrweb/typings/types';
44

55
import { sentryTest } from '../../../utils/fixtures';
66
import {
@@ -39,17 +39,17 @@ sentryTest('should mask input initial value and its changes', async ({ getLocalT
3939

4040
const text = 'this is test text';
4141

42-
await page.locator('#input').type(text)
42+
await page.locator('#input').type(text);
4343
const snapshots = getIncrementalRecordingSnapshots(await reqPromise1).filter(isInputMutation);
44-
const lastSnapshot = snapshots[snapshots.length-1];
44+
const lastSnapshot = snapshots[snapshots.length - 1];
4545
expect(lastSnapshot.text).toBe(text);
4646

47-
await page.locator('#input-masked').type(text)
47+
await page.locator('#input-masked').type(text);
4848
const snapshots2 = getIncrementalRecordingSnapshots(await reqPromise2).filter(isInputMutation);
49-
const lastSnapshot2 = snapshots2[snapshots2.length-1];
49+
const lastSnapshot2 = snapshots2[snapshots2.length - 1];
5050
expect(lastSnapshot2.text).toBe('*'.repeat(text.length));
5151

52-
await page.locator('#input-ignore').type(text)
52+
await page.locator('#input-ignore').type(text);
5353
const snapshots3 = getIncrementalRecordingSnapshots(await reqPromise3).filter(isInputMutation);
5454
expect(snapshots3.length).toBe(0);
5555
});
@@ -79,17 +79,17 @@ sentryTest('should mask textarea initial value and its changes', async ({ getLoc
7979
await reqPromise0;
8080

8181
const text = 'this is test text';
82-
await page.locator('#textarea').type(text)
82+
await page.locator('#textarea').type(text);
8383
const snapshots = getIncrementalRecordingSnapshots(await reqPromise1).filter(isInputMutation);
84-
const lastSnapshot = snapshots[snapshots.length-1];
84+
const lastSnapshot = snapshots[snapshots.length - 1];
8585
expect(lastSnapshot.text).toBe(text);
8686

87-
await page.locator('#textarea-masked').type(text)
87+
await page.locator('#textarea-masked').type(text);
8888
const snapshots2 = getIncrementalRecordingSnapshots(await reqPromise2).filter(isInputMutation);
89-
const lastSnapshot2 = snapshots2[snapshots2.length-1];
89+
const lastSnapshot2 = snapshots2[snapshots2.length - 1];
9090
expect(lastSnapshot2.text).toBe('*'.repeat(text.length));
9191

92-
await page.locator('#textarea-ignore').type(text)
92+
await page.locator('#textarea-ignore').type(text);
9393
const snapshots3 = getIncrementalRecordingSnapshots(await reqPromise3).filter(isInputMutation);
9494
expect(snapshots3.length).toBe(0);
9595
});
Lines changed: 61 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { expect } from '@playwright/test';
22
import { IncrementalSource } from '@sentry-internal/rrweb';
3-
import type { incrementalData, inputData} from '@sentry-internal/rrweb/typings/types';
3+
import type { incrementalData, inputData } from '@sentry-internal/rrweb/typings/types';
44

55
import { sentryTest } from '../../../utils/fixtures';
66
import {
@@ -13,73 +13,79 @@ function isInputMutation(snap: incrementalData): snap is inputData {
1313
return snap.source == IncrementalSource.Input;
1414
}
1515

16-
sentryTest('should mask input initial value and its changes from `maskAllInputs` and allow unmasked selector', async ({ getLocalTestPath, page }) => {
17-
if (shouldSkipReplayTest()) {
18-
sentryTest.skip();
19-
}
20-
21-
const reqPromise0 = waitForReplayRequest(page, 0);
22-
const reqPromise1 = waitForReplayRequest(page, 1);
23-
const reqPromise2 = waitForReplayRequest(page, 2);
24-
25-
await page.route('https://dsn.ingest.sentry.io/**/*', route => {
26-
return route.fulfill({
27-
status: 200,
28-
contentType: 'application/json',
29-
body: JSON.stringify({ id: 'test-id' }),
16+
sentryTest(
17+
'should mask input initial value and its changes from `maskAllInputs` and allow unmasked selector',
18+
async ({ getLocalTestPath, page }) => {
19+
if (shouldSkipReplayTest()) {
20+
sentryTest.skip();
21+
}
22+
23+
const reqPromise0 = waitForReplayRequest(page, 0);
24+
const reqPromise1 = waitForReplayRequest(page, 1);
25+
const reqPromise2 = waitForReplayRequest(page, 2);
26+
27+
await page.route('https://dsn.ingest.sentry.io/**/*', route => {
28+
return route.fulfill({
29+
status: 200,
30+
contentType: 'application/json',
31+
body: JSON.stringify({ id: 'test-id' }),
32+
});
3033
});
31-
});
3234

33-
const url = await getLocalTestPath({ testDir: __dirname });
35+
const url = await getLocalTestPath({ testDir: __dirname });
3436

35-
await page.goto(url);
37+
await page.goto(url);
3638

37-
await reqPromise0;
39+
await reqPromise0;
3840

39-
const text = 'this is test text';
41+
const text = 'this is test text';
4042

41-
await page.locator('#input').type(text)
42-
const snapshots = getIncrementalRecordingSnapshots(await reqPromise1).filter(isInputMutation);
43-
const lastSnapshot = snapshots[snapshots.length-1];
44-
expect(lastSnapshot.text).toBe('*'.repeat(text.length));
43+
await page.locator('#input').type(text);
44+
const snapshots = getIncrementalRecordingSnapshots(await reqPromise1).filter(isInputMutation);
45+
const lastSnapshot = snapshots[snapshots.length - 1];
46+
expect(lastSnapshot.text).toBe('*'.repeat(text.length));
4547

46-
await page.locator('#input-unmasked').type(text)
47-
const snapshots2 = getIncrementalRecordingSnapshots(await reqPromise2).filter(isInputMutation);
48-
const lastSnapshot2 = snapshots2[snapshots2.length-1];
49-
expect(lastSnapshot2.text).toBe(text);
50-
});
48+
await page.locator('#input-unmasked').type(text);
49+
const snapshots2 = getIncrementalRecordingSnapshots(await reqPromise2).filter(isInputMutation);
50+
const lastSnapshot2 = snapshots2[snapshots2.length - 1];
51+
expect(lastSnapshot2.text).toBe(text);
52+
},
53+
);
5154

52-
sentryTest('should mask textarea initial value and its changes from `maskAllInputs` and allow unmasked selector', async ({ getLocalTestPath, page }) => {
53-
if (shouldSkipReplayTest()) {
54-
sentryTest.skip();
55-
}
55+
sentryTest(
56+
'should mask textarea initial value and its changes from `maskAllInputs` and allow unmasked selector',
57+
async ({ getLocalTestPath, page }) => {
58+
if (shouldSkipReplayTest()) {
59+
sentryTest.skip();
60+
}
5661

57-
const reqPromise0 = waitForReplayRequest(page, 0);
58-
const reqPromise1 = waitForReplayRequest(page, 1);
59-
const reqPromise2 = waitForReplayRequest(page, 2);
62+
const reqPromise0 = waitForReplayRequest(page, 0);
63+
const reqPromise1 = waitForReplayRequest(page, 1);
64+
const reqPromise2 = waitForReplayRequest(page, 2);
6065

61-
await page.route('https://dsn.ingest.sentry.io/**/*', route => {
62-
return route.fulfill({
63-
status: 200,
64-
contentType: 'application/json',
65-
body: JSON.stringify({ id: 'test-id' }),
66+
await page.route('https://dsn.ingest.sentry.io/**/*', route => {
67+
return route.fulfill({
68+
status: 200,
69+
contentType: 'application/json',
70+
body: JSON.stringify({ id: 'test-id' }),
71+
});
6672
});
67-
});
6873

69-
const url = await getLocalTestPath({ testDir: __dirname });
74+
const url = await getLocalTestPath({ testDir: __dirname });
7075

71-
await page.goto(url);
76+
await page.goto(url);
7277

73-
await reqPromise0;
78+
await reqPromise0;
7479

75-
const text = 'this is test text';
76-
await page.locator('#textarea').type(text)
77-
const snapshots = getIncrementalRecordingSnapshots(await reqPromise1).filter(isInputMutation);
78-
const lastSnapshot = snapshots[snapshots.length-1];
79-
expect(lastSnapshot.text).toBe('*'.repeat(text.length));
80+
const text = 'this is test text';
81+
await page.locator('#textarea').type(text);
82+
const snapshots = getIncrementalRecordingSnapshots(await reqPromise1).filter(isInputMutation);
83+
const lastSnapshot = snapshots[snapshots.length - 1];
84+
expect(lastSnapshot.text).toBe('*'.repeat(text.length));
8085

81-
await page.locator('#textarea-unmasked').type(text)
82-
const snapshots2 = getIncrementalRecordingSnapshots(await reqPromise2).filter(isInputMutation);
83-
const lastSnapshot2 = snapshots2[snapshots2.length-1];
84-
expect(lastSnapshot2.text).toBe(text);
85-
});
86+
await page.locator('#textarea-unmasked').type(text);
87+
const snapshots2 = getIncrementalRecordingSnapshots(await reqPromise2).filter(isInputMutation);
88+
const lastSnapshot2 = snapshots2[snapshots2.length - 1];
89+
expect(lastSnapshot2.text).toBe(text);
90+
},
91+
);

packages/integration-tests/utils/replayHelpers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ function isReplayEvent(event: Event): event is ReplayEvent {
6161
return event.type === 'replay_event';
6262
}
6363

64-
function isIncrementalSnapshot(event: RecordingEvent): event is incrementalSnapshotEvent & { timestamp: number} {
64+
function isIncrementalSnapshot(event: RecordingEvent): event is incrementalSnapshotEvent & { timestamp: number } {
6565
return event.type === EventType.IncrementalSnapshot;
6666
}
6767

0 commit comments

Comments
 (0)