From e194e08b17225a7df5f4ba9d366fd9a4ff23c539 Mon Sep 17 00:00:00 2001 From: Yanzhen Yu Date: Wed, 1 Apr 2026 12:00:00 +0800 Subject: [PATCH] make the unit tests more stable --- test/__snapshots__/integration.test.ts.snap | 5 +-- test/__snapshots__/record.test.ts.snap | 38 +++++++++++++++++++++ test/html/block.html | 4 ++- 3 files changed, 44 insertions(+), 3 deletions(-) diff --git a/test/__snapshots__/integration.test.ts.snap b/test/__snapshots__/integration.test.ts.snap index afd9ce96..dea69d01 100644 --- a/test/__snapshots__/integration.test.ts.snap +++ b/test/__snapshots__/integration.test.ts.snap @@ -285,8 +285,9 @@ exports[`block 1`] = ` \\"tagName\\": \\"div\\", \\"attributes\\": { \\"class\\": \\"rr-block\\", - \\"rr_width\\": \\"1904px\\", - \\"rr_height\\": \\"19px\\" + \\"style\\": \\"width: 50px; height: 50px;\\", + \\"rr_width\\": \\"50px\\", + \\"rr_height\\": \\"50px\\" }, \\"childNodes\\": [], \\"id\\": 18 diff --git a/test/__snapshots__/record.test.ts.snap b/test/__snapshots__/record.test.ts.snap index 15dd136f..bd93f699 100644 --- a/test/__snapshots__/record.test.ts.snap +++ b/test/__snapshots__/record.test.ts.snap @@ -204,6 +204,44 @@ exports[`async-checkout 1`] = ` \\"top\\": 0 } } + }, + { + \\"type\\": 3, + \\"data\\": { + \\"source\\": 0, + \\"texts\\": [], + \\"attributes\\": [], + \\"removes\\": [ + { + \\"parentId\\": 8, + \\"id\\": 9 + } + ], + \\"adds\\": [ + { + \\"parentId\\": 4, + \\"previousId\\": 8, + \\"nextId\\": null, + \\"node\\": { + \\"type\\": 2, + \\"tagName\\": \\"span\\", + \\"attributes\\": {}, + \\"childNodes\\": [], + \\"id\\": 9 + } + }, + { + \\"parentId\\": 9, + \\"previousId\\": null, + \\"nextId\\": null, + \\"node\\": { + \\"type\\": 3, + \\"textContent\\": \\"test\\", + \\"id\\": 10 + } + } + ] + } } ]" `; diff --git a/test/html/block.html b/test/html/block.html index 84088997..6fee77f7 100644 --- a/test/html/block.html +++ b/test/html/block.html @@ -7,6 +7,8 @@ Block record -
+
+ +