From c7f99e70cc743702bc27df8efa3a99838e99522a Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Sat, 30 Nov 2024 11:42:19 +0000 Subject: Add test for retention of void elements --- test/html/simplify.tests.js | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'test/html/simplify.tests.js') 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}) -- cgit v1.2.3