diff options
| author | Michael Williamson <mike@zwobble.org> | 2024-11-30 11:45:59 +0000 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2024-11-30 11:45:59 +0000 |
| commit | ce471de77aa93bd2f6516c12f0b8e989382acf86 (patch) | |
| tree | 6a872c487633517a7f0ea16a7fe919d0be344529 /test/document-to-html.tests.js | |
| parent | 6dd60db56f7113d79443df933cd92c7f7570d751 (diff) | |
Convert checkbox to HTML
Diffstat (limited to 'test/document-to-html.tests.js')
| -rw-r--r-- | test/document-to-html.tests.js | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/document-to-html.tests.js b/test/document-to-html.tests.js index a18c4f5..8dc1e60 100644 --- a/test/document-to-html.tests.js +++ b/test/document-to-html.tests.js @@ -465,6 +465,22 @@ test('hyperlink target frame is used as anchor target', function() { }); }); +test('unchecked checkbox is converted to unchecked checkbox input', function() { + var checkbox = documents.checkbox({checked: false}); + var converter = new DocumentConverter(); + return converter.convertToHtml(checkbox).then(function(result) { + assert.equal(result.value, '<input type="checkbox" />'); + }); +}); + +test('checked checkbox is converted to checked checkbox input', function() { + var checkbox = documents.checkbox({checked: true}); + var converter = new DocumentConverter(); + return converter.convertToHtml(checkbox).then(function(result) { + assert.equal(result.value, '<input type="checkbox" checked="checked" />'); + }); +}); + test('bookmarks are converted to anchors', function() { var bookmarkStart = new documents.BookmarkStart({name: "_Peter"}); var converter = new DocumentConverter({ |
