aboutsummaryrefslogtreecommitdiff
path: root/tests/documents.tests.js
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2013-04-01 13:01:33 +0100
committerMichael Williamson <mike@zwobble.org>2013-04-01 13:01:33 +0100
commit5c7aa27a92265e0890f3b970ca8102751e0d7e01 (patch)
treeb427f4571c157b9b51acce59674d6b09d4119d0a /tests/documents.tests.js
parented1473a31a6294617bf239cc1fd15272fd7c9946 (diff)
Add mapping for run styles
Diffstat (limited to 'tests/documents.tests.js')
-rw-r--r--tests/documents.tests.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/documents.tests.js b/tests/documents.tests.js
index df10a92..d08500d 100644
--- a/tests/documents.tests.js
+++ b/tests/documents.tests.js
@@ -119,6 +119,18 @@ describe('DocumentConverter', function() {
assert.equal(result.html, "<strong><em>Hello.</em></strong>");
});
});
+
+ test('run styles are converted to HTML if mapping exists', function() {
+ var run = runOfText("Hello.", {styleName: "Emphasis"});
+ var converter = new DocumentConverter({
+ runStyleMap: {
+ "Emphasis": styles.elements(["strong"])
+ }
+ });
+ return converter.convertToHtml(run).then(function(result) {
+ assert.equal(result.html, "<strong>Hello.</strong>");
+ });
+ });
});
function paragraphOfText(text, styleName) {