aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2017-02-19 18:58:10 +0000
committerMichael Williamson <mike@zwobble.org>2017-02-19 18:58:10 +0000
commit40e958c90486dae503111ae82b9966d706d0e8fd (patch)
tree777504341dd9c6d30b56623dbcaa54d27d34bd05 /test
parentea988e3f229fc25638b8661171721c4a8ca683e3 (diff)
Fix handling of nested complex fields
Diffstat (limited to 'test')
-rw-r--r--test/docx/body-reader.tests.js28
1 files changed, 16 insertions, 12 deletions
diff --git a/test/docx/body-reader.tests.js b/test/docx/body-reader.tests.js
index fc34381..f4ee5d9 100644
--- a/test/docx/body-reader.tests.js
+++ b/test/docx/body-reader.tests.js
@@ -274,28 +274,32 @@ test("complex fields", (function() {
]);
var paragraphXml = new XmlElement("w:p", {}, [
beginXml,
+ hyperlinkInstrText,
+ separateXml,
beginXml,
authorInstrText,
- endXml,
- hyperlinkInstrText,
separateXml,
+ endXml,
hyperlinkRunXml,
endXml
]);
var paragraph = readXmlElementValue(paragraphXml);
+ var isEmptyHyperlinkedRun = isRun({
+ children: contains(
+ isHyperlink({
+ href: uri,
+ children: []
+ })
+ )
+ });
+
assertThat(paragraph.children, contains(
isEmptyRun,
- isEmptyRun,
- isEmptyRun,
- isRun({
- children: contains(
- isHyperlink({
- href: uri,
- children: []
- })
- )
- }),
+ isEmptyHyperlinkedRun,
+ isEmptyHyperlinkedRun,
+ isEmptyHyperlinkedRun,
+ isEmptyHyperlinkedRun,
isRun({
children: contains(
isHyperlink({