diff options
Diffstat (limited to 'test')
| -rw-r--r-- | test/docx/numbering-xml.tests.js | 26 |
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", {}, [])); |
