aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2026-09-26 21:57:10 +0100
committerMichael Williamson <mike@zwobble.org>2026-09-26 21:57:10 +0100
commit671dbb6ae5738d6bf8f97d13dd08bfc0a23e0b04 (patch)
tree275ea48c22a40f7702e6a40f0f58f46d6b39a7f3 /test
parentd1573743476bb99e8b9e3aba05e51ec51ae8f95f (diff)
Handle paragraphs and runs that have been moved and tracked as a revision
Diffstat (limited to 'test')
-rw-r--r--test/docx/body-reader.tests.js33
1 files changed, 33 insertions, 0 deletions
diff --git a/test/docx/body-reader.tests.js b/test/docx/body-reader.tests.js
index 197f19d..a8b9c7c 100644
--- a/test/docx/body-reader.tests.js
+++ b/test/docx/body-reader.tests.js
@@ -1758,6 +1758,26 @@ test("children of w:ins are converted normally", function() {
assertChildrenAreConvertedNormally("w:ins");
});
+test("children of w:moveFromRangeEnd are converted normally", function() {
+ assertChildrenAreConvertedNormally("w:moveFromRangeEnd");
+});
+
+test("children of w:moveFromRangeStart are converted normally", function() {
+ assertChildrenAreConvertedNormally("w:moveFromRangeStart");
+});
+
+test("children of w:moveTo are converted normally", function() {
+ assertChildrenAreConvertedNormally("w:moveTo");
+});
+
+test("children of w:moveToRangeEnd are converted normally", function() {
+ assertChildrenAreConvertedNormally("w:moveToRangeEnd");
+});
+
+test("children of w:moveToRangeStart are converted normally", function() {
+ assertChildrenAreConvertedNormally("w:moveToRangeStart");
+});
+
test("children of w:object are converted normally", function() {
assertChildrenAreConvertedNormally("w:object");
});
@@ -1978,6 +1998,19 @@ test("text nodes are ignored when reading children", function() {
assert.deepEqual(run, new documents.Run([]));
});
+test("w:moveFrom elements are ignored", function() {
+ assertElementIsIgnored("w:moveFrom");
+});
+
+function assertElementIsIgnored(tagName) {
+ var runXml = new XmlElement("w:r", {}, [
+ xml.element("w:t", {}, [xml.text("Blackdown")])
+ ]);
+ var result = readXmlElement(new XmlElement(tagName, {}, [runXml]));
+ assert.deepEqual(result.messages, []);
+ assert.deepEqual(result.value, []);
+}
+
function paragraphWithStyleId(styleId) {
return new XmlElement("w:p", {}, [
new XmlElement("w:pPr", {}, [