summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2024-11-30 11:42:19 +0000
committerMichael Williamson <mike@zwobble.org>2024-11-30 11:42:19 +0000
commitc7f99e70cc743702bc27df8efa3a99838e99522a (patch)
tree314c33643acffc5effeef027b8c18d30d4ed33d0
parent500e1c20fe77c7ebd561e9f7d8c2b494ebdfced2 (diff)
Add test for retention of void elements
-rw-r--r--test/html/simplify.tests.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/html/simplify.tests.js b/test/html/simplify.tests.js
index 85d2eb9..d9ab73a 100644
--- a/test/html/simplify.tests.js
+++ b/test/html/simplify.tests.js
@@ -37,6 +37,13 @@ test("empty children of element are removed", function() {
);
});
+test("empty void elements are not removed", function() {
+ assert.deepEqual(
+ simplifyNode(nonFreshElement("br", {}, [])),
+ [nonFreshElement("br", {}, [])]
+ );
+});
+
test("successive fresh elements are not collapsed", function() {
var path = htmlPaths.elements([
htmlPaths.element("p", {}, {fresh: true})