aboutsummaryrefslogtreecommitdiff
path: root/test/docx/numbering-xml.tests.js
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2021-05-11 22:24:27 +0100
committerMichael Williamson <mike@zwobble.org>2021-05-11 22:24:27 +0100
commit9420bb9bea5b44f475d32e12b2e50e96a888d900 (patch)
tree03be26b2232cb70a3510f2854e83f50c7865a182 /test/docx/numbering-xml.tests.js
parentc2d79f884373c93f1bd222f86c8057354837709a (diff)
Handle w:num with invalid w:abstractNumId
Diffstat (limited to 'test/docx/numbering-xml.tests.js')
-rw-r--r--test/docx/numbering-xml.tests.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/docx/numbering-xml.tests.js b/test/docx/numbering-xml.tests.js
index 1eefd37..1a20ab0 100644
--- a/test/docx/numbering-xml.tests.js
+++ b/test/docx/numbering-xml.tests.js
@@ -33,6 +33,19 @@ test('w:num element inherits levels from w:abstractNum', function() {
});
+test('w:num element referencing non-existent w:abstractNumId is ignored', function() {
+ var numbering = readNumberingXml(
+ new XmlElement("w:numbering", {}, [
+ new XmlElement("w:num", {"w:numId": "47"}, [
+ new XmlElement("w:abstractNumId", {"w:val": "42"})
+ ])
+ ]),
+ {styles: stylesReader.defaultStyles}
+ );
+ duck.assertThat(numbering.findLevel("47", "0"), duck.equalTo(null));
+});
+
+
test('when w:abstractNum has w:numStyleLink then style is used to find w:num', function() {
var numbering = readNumberingXml(
new XmlElement("w:numbering", {}, [