aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2013-05-03 21:27:00 +0100
committerMichael Williamson <mike@zwobble.org>2013-05-03 21:27:00 +0100
commitce01e3ec266ca3cbd96832766174e49337db98f8 (patch)
tree60a6bec29909354bd95ecac7319f94f9bbde1d1e /tests
parent23438dd97f93b86115cc4196c88d12e5168acbd5 (diff)
Replace paragraphStyleMap with more general styleMap
Diffstat (limited to 'tests')
-rw-r--r--tests/document-to-html.tests.js19
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>");