diff options
| author | Michael Williamson <mike@zwobble.org> | 2013-05-03 21:27:00 +0100 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2013-05-03 21:27:00 +0100 |
| commit | ce01e3ec266ca3cbd96832766174e49337db98f8 (patch) | |
| tree | 60a6bec29909354bd95ecac7319f94f9bbde1d1e /tests | |
| parent | 23438dd97f93b86115cc4196c88d12e5168acbd5 (diff) | |
Replace paragraphStyleMap with more general styleMap
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/document-to-html.tests.js | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/tests/document-to-html.tests.js b/tests/document-to-html.tests.js index 63eb435..7d49529 100644 --- a/tests/document-to-html.tests.js +++ b/tests/document-to-html.tests.js @@ -7,6 +7,7 @@ var test = require("./testing").test; var htmlPaths = require("../lib/html-paths"); var xmlreader = require("../lib/xmlreader"); var results = require("../lib/results"); +var documentMatchers = require("../lib/document-matchers"); describe('DocumentConverter', function() { @@ -76,9 +77,12 @@ describe('DocumentConverter', function() { paragraphOfText("Hello.", "Heading1"), ]); var converter = new DocumentConverter({ - paragraphStyleMap: { - "Heading1": htmlPaths.topLevelElement("h1") - } + styleMap: [ + { + from: documentMatchers.paragraph("Heading1"), + to: htmlPaths.topLevelElement("h1") + } + ] }); return converter.convertToHtml(document).then(function(result) { assert.equal(result.value, "<h1>Hello.</h1>"); @@ -100,9 +104,12 @@ describe('DocumentConverter', function() { paragraphOfText("Hello.", "Heading1") ]); var converter = new DocumentConverter({ - paragraphStyleMap: { - "Heading1": htmlPaths.elements(["h1", "span"]) - } + styleMap: [ + { + from: documentMatchers.paragraph("Heading1"), + to: htmlPaths.elements(["h1", "span"]) + } + ] }); return converter.convertToHtml(document).then(function(result) { assert.equal(result.value, "<h1><span>Hello.</span></h1>"); |
