aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2016-07-07 22:32:35 +0100
committerMichael Williamson <mike@zwobble.org>2016-07-07 22:32:35 +0100
commitade35ac659f20fc27bb4c87d8511789cc7d05c07 (patch)
treef378dac985b75161f5a3c81a4e28aa59c5b48c43 /test
parent30d04c156a26f40cb7f4cf72d66c3f29bb87ff60 (diff)
Handle comments without initials
Diffstat (limited to 'test')
-rw-r--r--test/document-to-html.tests.js14
1 files changed, 13 insertions, 1 deletions
diff --git a/test/document-to-html.tests.js b/test/document-to-html.tests.js
index af08050..cc8aff5 100644
--- a/test/document-to-html.tests.js
+++ b/test/document-to-html.tests.js
@@ -2,7 +2,9 @@ var assert = require("assert");
var promises = require("../lib/promises");
var documents = require("../lib/documents");
-var DocumentConverter = require("../lib/document-to-html").DocumentConverter;
+var documentToHtml = require("../lib/document-to-html");
+var DocumentConverter = documentToHtml.DocumentConverter;
+var commentAuthorLabel = documentToHtml.commentAuthorLabel;
var test = require("./test")(module);
var htmlPaths = require("../lib/html-paths");
var xml = require("../lib/xml");
@@ -612,3 +614,13 @@ function runOfText(text, properties) {
var textElement = new documents.Text(text);
return new documents.Run([textElement], properties);
}
+
+test('when initials are not blank then comment author label is initials', function() {
+ assert.equal(commentAuthorLabel({authorInitials: "TP"}), "TP")
+});
+
+test('when initials are blank then comment author label is blank', function() {
+ assert.equal(commentAuthorLabel({authorInitials: ""}), "")
+ assert.equal(commentAuthorLabel({authorInitials: undefined}), "")
+ assert.equal(commentAuthorLabel({authorInitials: null}), "")
+});