summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2019-03-17 20:53:23 +0000
committerMichael Williamson <mike@zwobble.org>2019-03-17 20:53:23 +0000
commite568765535b48643e1377dfd8479920fa755feb0 (patch)
tree5853eace48c39cc3e074e5f4ca6591db7da33f09 /test
parent82f8b03022950069c4ee2239e9fa4368fbecd661 (diff)
Follow w:numStyleLink in w:abstractNum
Diffstat (limited to 'test')
-rw-r--r--test/docx/numbering-xml.tests.js26
1 files changed, 26 insertions, 0 deletions
diff --git a/test/docx/numbering-xml.tests.js b/test/docx/numbering-xml.tests.js
index a9f825a..dd400a7 100644
--- a/test/docx/numbering-xml.tests.js
+++ b/test/docx/numbering-xml.tests.js
@@ -32,6 +32,32 @@ test('w:num element inherits levels from w:abstractNum', function() {
}));
});
+
+test('when w:abstractNum has w:numStyleLink then style is used to find w:num', function() {
+ var numbering = readNumberingXml(
+ new XmlElement("w:numbering", {}, [
+ new XmlElement("w:abstractNum", {"w:abstractNumId": "100"}, [
+ new XmlElement("w:lvl", {"w:ilvl": "0"}, [
+ new XmlElement("w:numFmt", {"w:val": "decimal"})
+ ])
+ ]),
+ new XmlElement("w:abstractNum", {"w:abstractNumId": "101"}, [
+ new XmlElement("w:numStyleLink", {"w:val": "List1"})
+ ]),
+ new XmlElement("w:num", {"w:numId": "200"}, [
+ new XmlElement("w:abstractNumId", {"w:val": "100"})
+ ]),
+ new XmlElement("w:num", {"w:numId": "201"}, [
+ new XmlElement("w:abstractNumId", {"w:val": "101"})
+ ])
+ ]),
+ {styles: new stylesReader.Styles({}, {}, {}, {"List1": {numId: "200"}})}
+ );
+ duck.assertThat(numbering.findLevel("201", "0"), duck.hasProperties({
+ isOrdered: true
+ }));
+});
+
test('when styles is missing then error is thrown', function() {
assert.throws(function() {
readNumberingXml(new XmlElement("w:numbering", {}, []));