diff options
| -rw-r--r-- | test/docx/body-reader.tests.js | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/test/docx/body-reader.tests.js b/test/docx/body-reader.tests.js index b1aab77..0aad67a 100644 --- a/test/docx/body-reader.tests.js +++ b/test/docx/body-reader.tests.js @@ -156,21 +156,22 @@ test("complex fields", (function() { var endXml = new XmlElement("w:r", {}, [ new XmlElement("w:fldChar", {"w:fldCharType": "end"}) ]); + var hyperlinkInstrText = new XmlElement("w:instrText", {}, [ + xml.text(' HYPERLINK "' + uri + '"') + ]); return { "stores instrText returns empty result": function() { - var instrTextXml = new XmlElement("w:instrText", {}, [xml.text(' HYPERLINK "http://example.com"')]); - var instrText = readXmlElementValue(instrTextXml); + var instrText = readXmlElementValue(hyperlinkInstrText); assert.deepEqual(instrText, []); }, "runs in a complex field for hyperlinks are read as hyperlinks": function() { - var instrTextXml = new XmlElement("w:instrText", {}, [xml.text(' HYPERLINK "' + uri + '"')]); var hyperlinkRunXml = runOfText("this is a hyperlink"); var afterEndXml = runOfText("this will not be a hyperlink"); var parXml = new XmlElement("w:p", {}, [ beginXml, - instrTextXml, + hyperlinkInstrText, hyperlinkRunXml, endXml, afterEndXml |
