aboutsummaryrefslogtreecommitdiff
path: root/tests/document-to-html.tests.js
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2013-04-27 22:38:01 +0100
committerMichael Williamson <mike@zwobble.org>2013-04-27 22:38:01 +0100
commit2642cdd90f25528df0d9501200bc95417e60ec82 (patch)
tree616d495bccaa000c550353412d648d6b56279f89 /tests/document-to-html.tests.js
parentcb18e8aa92108f8576c5d4312e89e6ddbabd88c8 (diff)
Add content-types to image elements
Diffstat (limited to 'tests/document-to-html.tests.js')
-rw-r--r--tests/document-to-html.tests.js14
1 files changed, 7 insertions, 7 deletions
diff --git a/tests/document-to-html.tests.js b/tests/document-to-html.tests.js
index a01018a..864e3ee 100644
--- a/tests/document-to-html.tests.js
+++ b/tests/document-to-html.tests.js
@@ -176,11 +176,11 @@ describe('DocumentConverter', function() {
test('images are written with data URIs', function() {
var imageBuffer = new Buffer("Not an image at all!");
- var image = new documents.Image(
- function(encoding) {
+ var image = new documents.Image({
+ readImage: function(encoding) {
return q.when(imageBuffer.toString(encoding));
}
- );
+ });
var converter = new DocumentConverter();
return converter.convertToHtml(image).then(function(result) {
assert.equal(result.value, '<img src="data:image/png;base64,' + imageBuffer.toString("base64") + '" />');
@@ -189,12 +189,12 @@ describe('DocumentConverter', function() {
test('images have alt attribute if available', function() {
var imageBuffer = new Buffer("Not an image at all!");
- var image = new documents.Image(
- function() {
+ var image = new documents.Image({
+ readImage: function() {
return q.when(imageBuffer);
},
- "It's a hat"
- );
+ altText: "It's a hat"
+ });
var converter = new DocumentConverter();
return converter.convertToHtml(image)
.then(function(result) {