aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
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
+ ));
}
};
})());