aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/document-to-html.tests.js17
1 files changed, 16 insertions, 1 deletions
diff --git a/tests/document-to-html.tests.js b/tests/document-to-html.tests.js
index 7180191..779c584 100644
--- a/tests/document-to-html.tests.js
+++ b/tests/document-to-html.tests.js
@@ -140,7 +140,7 @@ describe('DocumentConverter', function() {
});
});
- test('bold runs are wrapped in <strong> tags', function() {
+ test('bold runs are wrapped in <strong> tags by default', function() {
var run = runOfText("Hello.", {isBold: true});
var converter = new DocumentConverter();
return converter.convertToHtml(run).then(function(result) {
@@ -148,6 +148,21 @@ describe('DocumentConverter', function() {
});
});
+ test('bold runs can be configured with style mapping', function() {
+ var run = runOfText("Hello.", {isBold: true});
+ var converter = new DocumentConverter({
+ styleMap: [
+ {
+ from: documentMatchers.bold,
+ to: htmlPaths.elements([htmlPaths.element("em")])
+ }
+ ]
+ });
+ return converter.convertToHtml(run).then(function(result) {
+ assert.equal(result.value, "<em>Hello.</em>");
+ });
+ });
+
test('bold runs can exist inside other tags', function() {
var run = new documents.Paragraph([
runOfText("Hello.", {isBold: true})