diff options
| author | Michael Williamson <mike@zwobble.org> | 2014-04-10 13:57:36 +0100 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2014-04-10 13:57:36 +0100 |
| commit | 7e49d52fb9501a1bdd85d6c9d35d09d50aabb569 (patch) | |
| tree | 318923981d9ce853b33e5e72fc70b6292028df6e | |
| parent | 991e6d7cc1629bb472cb3ffabf0fca0be19da702 (diff) | |
Add test for nested HTML
| -rw-r--r-- | tests/html-writer.tests.js | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/html-writer.tests.js b/tests/html-writer.tests.js index 13faef7..8a40afb 100644 --- a/tests/html-writer.tests.js +++ b/tests/html-writer.tests.js @@ -12,4 +12,17 @@ describe('html-writer', function() { writer.close("p"); return assert.equal("<p>Hello</p>", writer.asString()); }); + + test('can nest elements', function() { + var writer = htmlWriter.writer(); + writer.open("ul"); + writer.open("li"); + writer.text("One"); + writer.close("li"); + writer.open("li"); + writer.text("Two"); + writer.close("li"); + writer.close("ul"); + return assert.equal("<ul><li>One</li><li>Two</li></ul>", writer.asString()); + }); }) |
