diff options
Diffstat (limited to 'tests/html/simplify.tests.js')
| -rw-r--r-- | tests/html/simplify.tests.js | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/html/simplify.tests.js b/tests/html/simplify.tests.js index 7893663..7e17903 100644 --- a/tests/html/simplify.tests.js +++ b/tests/html/simplify.tests.js @@ -33,4 +33,17 @@ describe("simplify", function() { fragment([ pathToNode(path, [text("Hello"), text(" there")])])); }); + + test("non-fresh can collapse into preceding non-fresh element", 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(freshPath, [text("Hello")]), + pathToNode(nonFreshPath, [text(" there")])])), + fragment([ + pathToNode(freshPath, [text("Hello"), text(" there")])])); + }); }); |
