From d4a14afabc917a06cd3ac67ccb03c69bf0299821 Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Sun, 6 Sep 2015 11:09:27 +0100 Subject: Add fallback content types --- tests/docx/content-types-reader.tests.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'tests/docx/content-types-reader.tests.js') diff --git a/tests/docx/content-types-reader.tests.js b/tests/docx/content-types-reader.tests.js index 3b8c1d3..3390e43 100644 --- a/tests/docx/content-types-reader.tests.js +++ b/tests/docx/content-types-reader.tests.js @@ -24,4 +24,17 @@ describe('readContentTypesFromXml', function() { }); assert.equal(contentTypes.findContentType("word/media/hat.png"), "image/hat"); }); + + test('fallback content types have common image types', function() { + var contentTypes = readContentTypesFromXml({ + root: new XmlElement("content-types:Types", {}, []) + }); + assert.equal(contentTypes.findContentType("word/media/hat.png"), "image/png"); + assert.equal(contentTypes.findContentType("word/media/hat.gif"), "image/gif"); + assert.equal(contentTypes.findContentType("word/media/hat.jpg"), "image/jpeg"); + assert.equal(contentTypes.findContentType("word/media/hat.jpeg"), "image/jpeg"); + assert.equal(contentTypes.findContentType("word/media/hat.bmp"), "image/bmp"); + assert.equal(contentTypes.findContentType("word/media/hat.tif"), "image/tiff"); + assert.equal(contentTypes.findContentType("word/media/hat.tiff"), "image/tiff"); + }); }); -- cgit v1.2.3