summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2023-05-20 18:37:32 +0100
committerMichael Williamson <mike@zwobble.org>2023-05-20 18:37:32 +0100
commit1ebe7f790778ce4f2035af1a85bdbb9b70a933c2 (patch)
tree4e462af00089bfb8beba6071d76323f09268fd53 /test
parent712e328c04ee6e23590ebd753723c2cb7e40f750 (diff)
Test deleted paragraph contents are only added once
Diffstat (limited to 'test')
-rw-r--r--test/docx/body-reader.tests.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/docx/body-reader.tests.js b/test/docx/body-reader.tests.js
index bbc3499..8dc9ab5 100644
--- a/test/docx/body-reader.tests.js
+++ b/test/docx/body-reader.tests.js
@@ -262,6 +262,11 @@ test("content of deleted paragraph is prepended to next paragraph", function() {
new XmlElement("w:pStyle", {"w:val": "Heading2"}, [])
]),
runOfText("Two")
+ ]),
+ // Include a second paragraph that isn't deleted to ensure we only add
+ // the deleted paragraph contents once.
+ new XmlElement("w:p", {}, [
+ runOfText("Three")
])
];
@@ -275,6 +280,12 @@ test("content of deleted paragraph is prepended to next paragraph", function() {
documents.run([documents.text("One")]),
documents.run([documents.text("Two")])
)
+ }),
+ hasProperties({
+ type: documents.types.paragraph,
+ children: contains(
+ documents.run([documents.text("Three")])
+ )
})
));