From 1ebe7f790778ce4f2035af1a85bdbb9b70a933c2 Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Sat, 20 May 2023 18:37:32 +0100 Subject: Test deleted paragraph contents are only added once --- test/docx/body-reader.tests.js | 11 +++++++++++ 1 file changed, 11 insertions(+) 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")]) + ) }) )); -- cgit v1.2.3