Skip to content

Commit a0cc839

Browse files
committed
Apply formatting changes
1 parent 4b930e3 commit a0cc839

File tree

1 file changed

+37
-11
lines changed

1 file changed

+37
-11
lines changed

packages/rrweb/test/integration.test.ts

Lines changed: 37 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,22 @@ import {
1212
ISuite,
1313
} from './utils';
1414
import type { recordOptions } from '../src/types';
15-
import { eventWithTime, EventType, RecordPlugin, IncrementalSource } from '@rrweb/types';
15+
import {
16+
eventWithTime,
17+
EventType,
18+
RecordPlugin,
19+
IncrementalSource,
20+
} from '@rrweb/types';
1621
import { visitSnapshot, NodeType } from 'rrweb-snapshot';
1722

1823
/**
1924
* Used to filter scroll events out of snapshots as they are flakey
2025
*/
2126
function isNotScroll(snapshot: eventWithTime) {
22-
return !(snapshot.type === EventType.IncrementalSnapshot && snapshot.data.source === IncrementalSource.Scroll)
27+
return !(
28+
snapshot.type === EventType.IncrementalSnapshot &&
29+
snapshot.data.source === IncrementalSource.Scroll
30+
);
2331
}
2432

2533
describe('record integration tests', function (this: ISuite) {
@@ -538,7 +546,7 @@ describe('record integration tests', function (this: ISuite) {
538546
assertSnapshot(snapshots);
539547
});
540548

541-
it('should record input values if dynamically added and maskAllInputs is false', async () => {
549+
it('should record input values if dynamically added and maskAllInputs is false', async () => {
542550
const page: puppeteer.Page = await browser.newPage();
543551
await page.goto('about:blank');
544552
await page.setContent(
@@ -556,7 +564,9 @@ describe('record integration tests', function (this: ISuite) {
556564

557565
await page.type('#input', 'moo');
558566

559-
const snapshots = await page.evaluate('window.snapshots') as eventWithTime[];
567+
const snapshots = (await page.evaluate(
568+
'window.snapshots',
569+
)) as eventWithTime[];
560570
assertSnapshot(snapshots.filter(isNotScroll));
561571
});
562572

@@ -579,15 +589,20 @@ describe('record integration tests', function (this: ISuite) {
579589

580590
await page.type('#textarea', 'moo');
581591

582-
const snapshots = await page.evaluate('window.snapshots') as eventWithTime[];
592+
const snapshots = (await page.evaluate(
593+
'window.snapshots',
594+
)) as eventWithTime[];
583595
assertSnapshot(snapshots.filter(isNotScroll));
584596
});
585597

586598
it('should not record input values if dynamically added, maskAllInputs is false, and mask selector is used', async () => {
587599
const page: puppeteer.Page = await browser.newPage();
588600
await page.goto('about:blank');
589601
await page.setContent(
590-
getHtml.call(this, 'empty.html', { maskAllInputs: false, maskTextSelector: '.rr-mask' }),
602+
getHtml.call(this, 'empty.html', {
603+
maskAllInputs: false,
604+
maskTextSelector: '.rr-mask',
605+
}),
591606
);
592607

593608
await page.evaluate(() => {
@@ -602,7 +617,9 @@ describe('record integration tests', function (this: ISuite) {
602617

603618
await page.type('#input-masked', 'moo');
604619

605-
const snapshots = await page.evaluate('window.snapshots') as eventWithTime[];
620+
const snapshots = (await page.evaluate(
621+
'window.snapshots',
622+
)) as eventWithTime[];
606623
assertSnapshot(snapshots.filter(isNotScroll));
607624
});
608625

@@ -624,7 +641,9 @@ describe('record integration tests', function (this: ISuite) {
624641

625642
await page.type('#input', 'moo');
626643

627-
const snapshots = await page.evaluate('window.snapshots') as eventWithTime[];
644+
const snapshots = (await page.evaluate(
645+
'window.snapshots',
646+
)) as eventWithTime[];
628647
assertSnapshot(snapshots.filter(isNotScroll));
629648
});
630649

@@ -647,15 +666,20 @@ describe('record integration tests', function (this: ISuite) {
647666

648667
await page.type('#textarea', 'moo');
649668

650-
const snapshots = await page.evaluate('window.snapshots') as eventWithTime[];
669+
const snapshots = (await page.evaluate(
670+
'window.snapshots',
671+
)) as eventWithTime[];
651672
assertSnapshot(snapshots.filter(isNotScroll));
652673
});
653674

654675
it('should record input values if dynamically added, maskAllInputs is true, and unmask selector is used', async () => {
655676
const page: puppeteer.Page = await browser.newPage();
656677
await page.goto('about:blank');
657678
await page.setContent(
658-
getHtml.call(this, 'empty.html', { maskAllInputs: true, unmaskTextSelector: '.rr-unmask'}),
679+
getHtml.call(this, 'empty.html', {
680+
maskAllInputs: true,
681+
unmaskTextSelector: '.rr-unmask',
682+
}),
659683
);
660684

661685
await page.evaluate(() => {
@@ -670,7 +694,9 @@ describe('record integration tests', function (this: ISuite) {
670694

671695
await page.type('#input-unmasked', 'moo');
672696

673-
const snapshots = await page.evaluate('window.snapshots') as eventWithTime[];
697+
const snapshots = (await page.evaluate(
698+
'window.snapshots',
699+
)) as eventWithTime[];
674700
assertSnapshot(snapshots.filter(isNotScroll));
675701
});
676702

0 commit comments

Comments
 (0)