diff options
Diffstat (limited to 'tests/html')
| -rw-r--r-- | tests/html/simplify.tests.js | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/html/simplify.tests.js b/tests/html/simplify.tests.js index 2a16ba4..db7beb4 100644 --- a/tests/html/simplify.tests.js +++ b/tests/html/simplify.tests.js @@ -78,4 +78,18 @@ describe("simplify", function() { nonFreshElement("blockquote", {}, [nonFreshElement("p", {}, [text("there")])])])), fragment([nonFreshElement("blockquote", {}, [nonFreshElement("p", {}, [text("Hello"), text("there")])])])); }); + + test("empty elements are removed before collapsing", function() { + var freshPath = htmlPaths.elements([ + htmlPaths.element("p", {}, {fresh: true})]); + var nonFreshPath = htmlPaths.elements([ + htmlPaths.element("p", {}, {fresh: false})]); + assert.deepEqual( + html.simplify(fragment([ + pathToNode(nonFreshPath, [text("Hello")]), + pathToNode(freshPath, []), + pathToNode(nonFreshPath, [text(" there")])])), + fragment([ + pathToNode(nonFreshPath, [text("Hello"), text(" there")])])); + }); }); |
