From e7803837d2a0214bc144f640bf3e2482c19ac35f Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Mon, 1 Nov 2021 19:08:28 +0000 Subject: Handle a:blip elements without image file --- test/docx/body-reader.tests.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'test') diff --git a/test/docx/body-reader.tests.js b/test/docx/body-reader.tests.js index c539aad..2e53200 100644 --- a/test/docx/body-reader.tests.js +++ b/test/docx/body-reader.tests.js @@ -1087,6 +1087,18 @@ test("can read linked pictures", function() { })); }); +test("warning if blip has no image file", function() { + var drawing = createInlineImage({ + blip: new XmlElement("a:blip"), + description: "It's a hat" + }); + + var result = readXmlElement(drawing); + + assert.deepEqual(result.messages, [warning("Could not find image file for a:blip element")]); + assert.deepEqual(result.value, []); +}); + test("warning if unsupported image type", function() { var drawing = createInlineImage({ blip: createEmbeddedBlip("rId5"), -- cgit v1.2.3