summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2024-11-30 11:45:59 +0000
committerMichael Williamson <mike@zwobble.org>2024-11-30 11:45:59 +0000
commitce471de77aa93bd2f6516c12f0b8e989382acf86 (patch)
tree6a872c487633517a7f0ea16a7fe919d0be344529 /test
parent6dd60db56f7113d79443df933cd92c7f7570d751 (diff)
Convert checkbox to HTML
Diffstat (limited to 'test')
-rw-r--r--test/document-to-html.tests.js16
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({