From 1e85fcd0539d71484a4b5f44e1f0ccd0f48a90ec Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Mon, 23 Jan 2017 20:05:52 +0000 Subject: Add test for base-relative targets --- test/mammoth.tests.js | 9 ++++++++- test/test-data/tiny-picture-target-base-relative.docx | Bin 0 -> 10881 bytes 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 test/test-data/tiny-picture-target-base-relative.docx diff --git a/test/mammoth.tests.js b/test/mammoth.tests.js index 43b4fe3..2dbdbe4 100644 --- a/test/mammoth.tests.js +++ b/test/mammoth.tests.js @@ -205,13 +205,20 @@ test('mammoth.transforms.paragraph only transforms paragraphs', function() { }); }); -test('inline images are included in output', function() { +test('inline images referenced by path relative to part are included in output', function() { var docxPath = path.join(__dirname, "test-data/tiny-picture.docx"); return mammoth.convertToHtml({path: docxPath}).then(function(result) { assert.equal(result.value, '

'); }); }); +test('inline images referenced by path relative to base are included in output', function() { + var docxPath = path.join(__dirname, "test-data/tiny-picture-target-base-relative.docx"); + return mammoth.convertToHtml({path: docxPath}).then(function(result) { + assert.equal(result.value, '

'); + }); +}); + test('src of inline images can be changed', function() { var docxPath = path.join(__dirname, "test-data/tiny-picture.docx"); var convertImage = mammoth.images.imgElement(function(element) { diff --git a/test/test-data/tiny-picture-target-base-relative.docx b/test/test-data/tiny-picture-target-base-relative.docx new file mode 100644 index 0000000..1d61988 Binary files /dev/null and b/test/test-data/tiny-picture-target-base-relative.docx differ -- cgit v1.2.3