diff options
| author | Michael Williamson <mike@zwobble.org> | 2015-10-14 19:59:21 +0100 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2015-10-14 19:59:21 +0100 |
| commit | b97b74396876577d3edeb8486a9aebeb234f85ac (patch) | |
| tree | 45f8ffd16e0284e8355872cce4f06969164874ab /tests/html | |
| parent | 0b7a06d79c070f1dc25858a577e86b5b6e348d27 (diff) | |
Fix recursive collapsing elements
Diffstat (limited to 'tests/html')
| -rw-r--r-- | tests/html/simplify.tests.js | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/tests/html/simplify.tests.js b/tests/html/simplify.tests.js index 27b9de0..2a16ba4 100644 --- a/tests/html/simplify.tests.js +++ b/tests/html/simplify.tests.js @@ -29,7 +29,7 @@ describe("simplify", function() { fragment([])); }); - test("children of element is simplified", function() { + test("empty children of element are removed", function() { assert.deepEqual( html.simplify(fragment([nonFreshElement("p", {}, [text("Hello"), text("")])])), fragment([nonFreshElement("p", {}, [text("Hello")])])); @@ -70,4 +70,12 @@ describe("simplify", function() { fragment([ pathToNode(freshPath, [text("Hello"), text(" there")])])); }); + + test("children of collapsed element can collapse with children of another collapsed element", function() { + assert.deepEqual( + html.simplify(fragment([ + nonFreshElement("blockquote", {}, [nonFreshElement("p", {}, [text("Hello")])]), + nonFreshElement("blockquote", {}, [nonFreshElement("p", {}, [text("there")])])])), + fragment([nonFreshElement("blockquote", {}, [nonFreshElement("p", {}, [text("Hello"), text("there")])])])); + }); }); |
