From 0ce9db9b7c6e24f8384564bd4bde3af970a8db98 Mon Sep 17 00:00:00 2001 From: Justin Halsall Date: Mon, 9 Jan 2023 12:00:42 +0100 Subject: [PATCH] Round the currentTime to 1 decimal place --- packages/rrweb/test/utils.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/packages/rrweb/test/utils.ts b/packages/rrweb/test/utils.ts index b1c799498d..d4bd396f63 100644 --- a/packages/rrweb/test/utils.ts +++ b/packages/rrweb/test/utils.ts @@ -185,6 +185,14 @@ function stringifySnapshots(snapshots: eventWithTime[]): string { } } }); + } else if ( + s.type === EventType.IncrementalSnapshot && + s.data.source === IncrementalSource.MediaInteraction + ) { + // round the currentTime to 1 decimal place + if (s.data.currentTime) { + s.data.currentTime = Math.round(s.data.currentTime * 10) / 10; + } } delete (s as Optional).timestamp; return s as event;