diff options
| author | Michael Williamson <mike@zwobble.org> | 2026-12-05 10:19:25 +0000 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2026-12-05 10:19:25 +0000 |
| commit | ae06a2bacfb74c88340e900e8a29336418936e9e (patch) | |
| tree | 57f48a831f4c34fc45c5a18994007d8713393819 /test/docx/office-xml-reader.tests.js | |
| parent | 5171a9072f8b7343ab1c9ed3a15d6d372cb59b67 (diff) | |
Handle XML documents that are missing a root element
Diffstat (limited to 'test/docx/office-xml-reader.tests.js')
| -rw-r--r-- | test/docx/office-xml-reader.tests.js | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/docx/office-xml-reader.tests.js b/test/docx/office-xml-reader.tests.js index a017315..6adb970 100644 --- a/test/docx/office-xml-reader.tests.js +++ b/test/docx/office-xml-reader.tests.js @@ -4,6 +4,15 @@ var xml = require("../../lib/xml"); var officeXmlReader = require("../../lib/docx/office-xml-reader"); var test = require("../test")(module); +test("read", { + "when document is missing root element then null is returned": function() { + var xmlString = '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>'; + + return officeXmlReader.read(xmlString).then(function(element) { + assert.strictEqual(element, null); + }); + } +}); test("mc:AlternateContent", { "when mc:Fallback is present then mc:Fallback is read": function() { |
