diff options
| author | Michael Williamson <mike@zwobble.org> | 2017-04-03 10:36:05 +0100 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2017-04-03 10:36:05 +0100 |
| commit | ff3dfe86e69ea8f3c8f308339ee5114003a530bf (patch) | |
| tree | b810312c454f58db19efc2c66a664107616414f6 /test | |
| parent | 284be64be74acd72df87fcda4b588a6d3ed59723 (diff) | |
Read children of w:object elements
Diffstat (limited to 'test')
| -rw-r--r-- | test/docx/body-reader.tests.js | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/test/docx/body-reader.tests.js b/test/docx/body-reader.tests.js index c3d5556..1b9a392 100644 --- a/test/docx/body-reader.tests.js +++ b/test/docx/body-reader.tests.js @@ -834,18 +834,22 @@ test("no elements created if image cannot be found in wp:inline", function() { }); test("children of w:ins are converted normally", function() { - var runXml = new XmlElement("w:r", {}, []); - var insXml = new XmlElement("w:ins", {}, [runXml]); - var result = readXmlElement(insXml); - assert.deepEqual(result.value[0].type, "run"); + assertChildrenAreConvertedNormally("w:ins"); +}); + +test("children of w:object are converted normally", function() { + assertChildrenAreConvertedNormally("w:object"); }); test("children of w:smartTag are converted normally", function() { + assertChildrenAreConvertedNormally("w:smartTag"); +}); + +function assertChildrenAreConvertedNormally(tagName) { var runXml = new XmlElement("w:r", {}, []); - var smartTagXml = new XmlElement("w:smartTag", {}, [runXml]); - var result = readXmlElement(smartTagXml); + var result = readXmlElement(new XmlElement(tagName, {}, [runXml])); assert.deepEqual(result.value[0].type, "run"); -}); +} test("w:hyperlink is read as document hyperlink if it has a relationship ID", function() { var runXml = new XmlElement("w:r", {}, []); |
