aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2017-02-16 11:24:08 +0000
committerMichael Williamson <mike@zwobble.org>2017-02-16 11:24:08 +0000
commit56020bc35f1e7f93989a5b38686cee515ba31b36 (patch)
tree495cd93c91331e2450201094f20a71faa8742e5a /test
parentfef4b00a315d85d061ab3218380283345e7d1aa1 (diff)
Extract hyperlinkInstrText
Diffstat (limited to 'test')
-rw-r--r--test/docx/body-reader.tests.js9
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