Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
remove redundant text nodes for script node
  • Loading branch information
YunFeng0817 committed Jul 3, 2024
commit 71245d773b25ca743f72af7b11a99e902f99056f
48 changes: 14 additions & 34 deletions packages/rrweb/test/__snapshots__/integration.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -15921,26 +15921,6 @@ exports[`record integration tests > should record style mutations and replay the
\\"type\\": 3,
\\"textContent\\": \\"SCRIPT_PLACEHOLDER\\",
\\"id\\": 10
},
{
\\"type\\": 3,
\\"textContent\\": \\"SCRIPT_PLACEHOLDER\\",
\\"id\\": 11
},
{
\\"type\\": 3,
\\"textContent\\": \\"SCRIPT_PLACEHOLDER\\",
\\"id\\": 12
},
{
\\"type\\": 3,
\\"textContent\\": \\"SCRIPT_PLACEHOLDER\\",
\\"id\\": 13
},
{
\\"type\\": 3,
\\"textContent\\": \\"SCRIPT_PLACEHOLDER\\",
\\"id\\": 14
}
],
\\"id\\": 9
Expand All @@ -15951,7 +15931,7 @@ exports[`record integration tests > should record style mutations and replay the
{
\\"type\\": 3,
\\"textContent\\": \\"\\\\n \\",
\\"id\\": 15
\\"id\\": 11
},
{
\\"type\\": 2,
Expand All @@ -15961,7 +15941,7 @@ exports[`record integration tests > should record style mutations and replay the
{
\\"type\\": 3,
\\"textContent\\": \\"\\\\n\\\\t \\",
\\"id\\": 17
\\"id\\": 13
},
{
\\"type\\": 2,
Expand All @@ -15970,12 +15950,12 @@ exports[`record integration tests > should record style mutations and replay the
\\"id\\": \\"one\\"
},
\\"childNodes\\": [],
\\"id\\": 18
\\"id\\": 14
},
{
\\"type\\": 3,
\\"textContent\\": \\"\\\\n \\",
\\"id\\": 19
\\"id\\": 15
},
{
\\"type\\": 2,
Expand All @@ -15984,12 +15964,12 @@ exports[`record integration tests > should record style mutations and replay the
\\"id\\": \\"two\\"
},
\\"childNodes\\": [],
\\"id\\": 20
\\"id\\": 16
},
{
\\"type\\": 3,
\\"textContent\\": \\"\\\\n\\\\t \\",
\\"id\\": 21
\\"id\\": 17
},
{
\\"type\\": 2,
Expand All @@ -15999,18 +15979,18 @@ exports[`record integration tests > should record style mutations and replay the
{
\\"type\\": 3,
\\"textContent\\": \\"SCRIPT_PLACEHOLDER\\",
\\"id\\": 23
\\"id\\": 19
}
],
\\"id\\": 22
\\"id\\": 18
},
{
\\"type\\": 3,
\\"textContent\\": \\"\\\\n \\\\n \\",
\\"id\\": 24
\\"id\\": 20
}
],
\\"id\\": 16
\\"id\\": 12
}
],
\\"id\\": 3
Expand Down Expand Up @@ -16042,17 +16022,17 @@ exports[`record integration tests > should record style mutations and replay the
\\"_cssText\\": \\"#two { color: rgb(255, 0, 0); }\\"
},
\\"childNodes\\": [],
\\"id\\": 25
\\"id\\": 21
}
},
{
\\"parentId\\": 25,
\\"parentId\\": 21,
\\"nextId\\": null,
\\"node\\": {
\\"type\\": 3,
\\"textContent\\": \\"#two { color: rgb(255, 0, 0); }\\",
\\"isStyle\\": true,
\\"id\\": 26
\\"id\\": 22
}
}
]
Expand All @@ -16076,7 +16056,7 @@ exports[`record integration tests > should record style mutations and replay the
\\"type\\": 3,
\\"data\\": {
\\"source\\": 13,
\\"id\\": 25,
\\"id\\": 21,
\\"set\\": {
\\"property\\": \\"color\\",
\\"value\\": \\"rgb(255, 255, 0)\\"
Expand Down
2 changes: 1 addition & 1 deletion packages/rrweb/test/integration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1270,7 +1270,7 @@ describe('record integration tests', function (this: ISuite) {
await page.evaluate(
(code, recordSnippet) => {
const script = document.createElement('script');
script.innerHTML = `${code}window.Date.now = () => new Date(Date.UTC(2018, 10, 15, 8)).valueOf();${recordSnippet}`;
script.textContent = `${code}window.Date.now = () => new Date(Date.UTC(2018, 10, 15, 8)).valueOf();${recordSnippet}`;
document.head.appendChild(script);
},
code,
Expand Down