diff options
| author | Michael Williamson <mike@zwobble.org> | 2016-07-03 19:19:21 +0100 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2016-07-03 19:20:00 +0100 |
| commit | 0b56dfce42c3944cce47e284608e6806f4c839c3 (patch) | |
| tree | 5f96f9c2908f1c5b00a7192e71d4c192abd7cf47 /test/docx/office-xml-reader.tests.js | |
| parent | 627c4a755395e313234bdb1914d168392006c483 (diff) | |
Move tests to test for easier Mocha usage
Diffstat (limited to 'test/docx/office-xml-reader.tests.js')
| -rw-r--r-- | test/docx/office-xml-reader.tests.js | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/test/docx/office-xml-reader.tests.js b/test/docx/office-xml-reader.tests.js new file mode 100644 index 0000000..9d202ba --- /dev/null +++ b/test/docx/office-xml-reader.tests.js @@ -0,0 +1,26 @@ +var assert = require("assert"); + +var xml = require("../../lib/xml"); +var officeXmlReader = require("../../lib/docx/office-xml-reader"); +var test = require("../testing").test; + + +describe("office-xml-reader", function() { + test("mc:AlternateContent is replaced by contents of mc:Fallback", function() { + var xmlString = + '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>' + + '<numbering xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006">' + + '<mc:AlternateContent>' + + '<mc:Choice Requires="w14">' + + '<choice/>' + + '</mc:Choice>' + + '<mc:Fallback>' + + '<fallback/>' + + '</mc:Fallback>' + + '</mc:AlternateContent>' + + '</numbering>'; + return officeXmlReader.read(xmlString).then(function(element) { + assert.deepEqual(element.root.children, [xml.element("fallback")]); + }); + }); +}); |
