Skip to content

Commit 8521f87

Browse files
committed
fix flaky?
1 parent b852115 commit 8521f87

File tree

1 file changed

+19
-2
lines changed
  • packages/integration-tests/suites/replay/privacyInputMaskAll

1 file changed

+19
-2
lines changed

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

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,26 @@ for (let i = 0; i < 100; i++) {
8484
sentryTest.skip();
8585
}
8686

87+
// We want to ensure to check the correct event payloads
88+
let firstInputMutationSegmentId: number | undefined = undefined;
8789
const reqPromise0 = waitForReplayRequest(page, 0);
88-
const reqPromise1 = waitForReplayRequest(page, 1);
89-
const reqPromise2 = waitForReplayRequest(page, 2);
90+
const reqPromise1 = waitForReplayRequest(page, (event, res) => {
91+
const check =
92+
firstInputMutationSegmentId === undefined && getIncrementalRecordingSnapshots(res).some(isInputMutation);
93+
94+
if (check) {
95+
firstInputMutationSegmentId = event.segment_id;
96+
}
97+
98+
return check;
99+
});
100+
const reqPromise2 = waitForReplayRequest(page, (event, res) => {
101+
return (
102+
typeof firstInputMutationSegmentId === 'number' &&
103+
firstInputMutationSegmentId < event.segment_id &&
104+
getIncrementalRecordingSnapshots(res).some(isInputMutation)
105+
);
106+
});
90107

91108
await page.route('https://dsn.ingest.sentry.io/**/*', route => {
92109
return route.fulfill({

0 commit comments

Comments
 (0)