Skip to content

Commit d281080

Browse files
committed
fixup! Move mutation tests into their own files to demonstrate an idea which could be applied across all snapshots. Also, only mutation events are relevant here (reduce burden when manually expecting test output). Also (commented out) showing how to reuse expected output between tests, i.e. assert that two tests produce same output
1 parent bb695f2 commit d281080

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

packages/rrweb/test/record/mutation.test.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,9 @@ describe('mutation', () => {
223223
d1.append(siblingDiv);
224224
});
225225
await waitForRAF(page);
226-
const mutations = events.filter((e)=>e.type === EventType.IncrementalSnapshot);
226+
const mutations = events.filter(
227+
(e) => e.type === EventType.IncrementalSnapshot,
228+
);
227229
await assertSnapshot(mutations, true);
228230
});
229231

@@ -242,7 +244,9 @@ describe('mutation', () => {
242244
d1.append(siblingDiv2);
243245
});
244246
await waitForRAF(page);
245-
const mutations = events.filter((e)=>e.type === EventType.IncrementalSnapshot);
247+
const mutations = events.filter(
248+
(e) => e.type === EventType.IncrementalSnapshot,
249+
);
246250
await assertSnapshot(mutations, true);
247251
});
248252

@@ -259,7 +263,9 @@ describe('mutation', () => {
259263
d1.append(b1);
260264
});
261265
await waitForRAF(page);
262-
const mutations = events.filter((e)=>e.type === EventType.IncrementalSnapshot);
266+
const mutations = events.filter(
267+
(e) => e.type === EventType.IncrementalSnapshot,
268+
);
263269
await assertSnapshot(mutations, true);
264270
});
265271

0 commit comments

Comments
 (0)