aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2017-04-22 15:46:01 +0100
committerMichael Williamson <mike@zwobble.org>2017-04-22 15:46:42 +0100
commit53e02510f14a4ed91d1ef5f194be564a83e05fb4 (patch)
tree5f09485c80ce9cefc5a447cbf3f73d3ea074473e /test
parentcedd2d6d5401b78030318f9e64f684d6ea86085d (diff)
Handle complex fields that do not have a "separate" fldChar
Diffstat (limited to 'test')
-rw-r--r--test/docx/body-reader.tests.js27
1 files changed, 27 insertions, 0 deletions
diff --git a/test/docx/body-reader.tests.js b/test/docx/body-reader.tests.js
index 1b9a392..ffcc7d8 100644
--- a/test/docx/body-reader.tests.js
+++ b/test/docx/body-reader.tests.js
@@ -309,6 +309,33 @@ test("complex fields", (function() {
isEmptyHyperlinkedRun,
isEmptyRun
));
+ },
+
+ "field without separate element is ignored": function() {
+ var hyperlinkRunXml = runOfText("this is a hyperlink");
+ var paragraphXml = new XmlElement("w:p", {}, [
+ beginXml,
+ hyperlinkInstrText,
+ separateXml,
+ beginXml,
+ endXml,
+ hyperlinkRunXml,
+ endXml
+ ]);
+ var paragraph = readXmlElementValue(paragraphXml);
+
+ assertThat(paragraph.children, contains(
+ isEmptyRun,
+ isEmptyHyperlinkedRun,
+ isEmptyHyperlinkedRun,
+ isEmptyHyperlinkedRun,
+ isHyperlinkedRun({
+ children: contains(
+ isText("this is a hyperlink")
+ )
+ }),
+ isEmptyRun
+ ));
}
};
})());