From 89d074071d250a23264e9ab82bb896af3e5ce674 Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Mon, 1 Apr 2013 22:39:47 +0100 Subject: Fix image generation --- tests/docx-reader.tests.js | 2 +- tests/mammoth.tests.js | 9 +++++++++ tests/test-data/tiny-picture.docx | Bin 0 -> 13699 bytes 3 files changed, 10 insertions(+), 1 deletion(-) create mode 100755 tests/test-data/tiny-picture.docx (limited to 'tests') diff --git a/tests/docx-reader.tests.js b/tests/docx-reader.tests.js index 9f431b7..8971782 100644 --- a/tests/docx-reader.tests.js +++ b/tests/docx-reader.tests.js @@ -146,7 +146,7 @@ describe("readElement", function() { "rId5": {target: "media/hat.png"} }, createFakeDocxFile({ - "media/hat.png": imageBuffer + "word/media/hat.png": imageBuffer }) ); var result = reader.readXmlElement(drawing); diff --git a/tests/mammoth.tests.js b/tests/mammoth.tests.js index e963257..f8e799d 100644 --- a/tests/mammoth.tests.js +++ b/tests/mammoth.tests.js @@ -1,4 +1,5 @@ var assert = require("assert"); +var path = require("path"); var mammoth = require("../") var styles = require("../lib/styles"); @@ -31,4 +32,12 @@ describe('mammoth', function() { assert.equal("

Hello.

", result.html); }); }); + + test('inline images are included in output', function() { + var converter = new mammoth.Converter(); + var docxPath = path.join(__dirname, "test-data/tiny-picture.docx"); + return converter.convertToHtml(docxPath).then(function(result) { + assert.equal(result.html, '

'); + }); + }); }) diff --git a/tests/test-data/tiny-picture.docx b/tests/test-data/tiny-picture.docx new file mode 100755 index 0000000..d45bb9e Binary files /dev/null and b/tests/test-data/tiny-picture.docx differ -- cgit v1.2.3