diff options
| author | Michael Williamson <mike@zwobble.org> | 2015-09-06 11:09:27 +0100 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2015-09-06 11:09:27 +0100 |
| commit | d4a14afabc917a06cd3ac67ccb03c69bf0299821 (patch) | |
| tree | 3c3af86f20e4ef3b933a0a5e3218dd0bcb2d8a0d /tests | |
| parent | a274a2f176303bfec529edecb8cc1773daf8ae31 (diff) | |
Add fallback content types
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/docx/content-types-reader.tests.js | 13 |
1 files changed, 13 insertions, 0 deletions
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"); + }); }); |
