Skip to content

Commit

Permalink
Need a longer seek here to account for slower recording during testing
Browse files Browse the repository at this point in the history
  • Loading branch information
eoghanmurray committed Nov 9, 2023
1 parent a56177f commit bc00434
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/rrweb/test/integration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,9 @@ describe('record integration tests', function (this: ISuite) {
const page: puppeteer.Page = await browser.newPage();
await page.goto('about:blank');
await page.setContent(getHtml.call(this, 'empty.html'));

await new Promise((resolve) => setTimeout(resolve, 20)); // ensure mutations aren't included in fullsnapshot

await page.evaluate(() => {
const ta = document.createElement('textarea');
ta.innerText = 'pre value'; // this mutation should be recorded
Expand Down Expand Up @@ -147,7 +150,7 @@ describe('record integration tests', function (this: ISuite) {
const replayer = new Replayer(window.snapshots);
replayer.pause(100);
let val = replayer.iframe.contentDocument.querySelector('textarea').value + '|';
replayer.pause(250);
replayer.pause(300);
val + replayer.iframe.contentDocument.querySelector('textarea').value;
`);
expect(replayResult).toEqual('pre value ok|12pre value ok'); // test at 2 times
Expand Down

0 comments on commit bc00434

Please sign in to comment.