diff options
| author | Michael Williamson <mike@zwobble.org> | 2019-03-17 20:42:08 +0000 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2019-03-17 20:42:08 +0000 |
| commit | 82f8b03022950069c4ee2239e9fa4368fbecd661 (patch) | |
| tree | 3dc42ac0e7ef034cd96d1f2e49dac91deaa757e1 /test/docx/numbering-xml.tests.js | |
| parent | 5738d470f9997ae7037748e739bc936ca48ee71e (diff) | |
Pass styles into readNumberingXml
Diffstat (limited to 'test/docx/numbering-xml.tests.js')
| -rw-r--r-- | test/docx/numbering-xml.tests.js | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/test/docx/numbering-xml.tests.js b/test/docx/numbering-xml.tests.js index 7ecacc2..a9f825a 100644 --- a/test/docx/numbering-xml.tests.js +++ b/test/docx/numbering-xml.tests.js @@ -1,6 +1,8 @@ +var assert = require("assert"); var duck = require("duck"); var readNumberingXml = require("../../lib/docx/numbering-xml").readNumberingXml; +var stylesReader = require("../../lib/docx/styles-reader"); var XmlElement = require("../../lib/xml").Element; var test = require("../test")(module); @@ -19,7 +21,8 @@ test('w:num element inherits levels from w:abstractNum', function() { new XmlElement("w:num", {"w:numId": "47"}, [ new XmlElement("w:abstractNumId", {"w:val": "42"}) ]) - ]) + ]), + {styles: stylesReader.defaultStyles} ); duck.assertThat(numbering.findLevel("47", "0"), duck.hasProperties({ isOrdered: false @@ -28,3 +31,9 @@ test('w:num element inherits levels from w:abstractNum', function() { isOrdered: true })); }); + +test('when styles is missing then error is thrown', function() { + assert.throws(function() { + readNumberingXml(new XmlElement("w:numbering", {}, [])); + }, /styles is missing/); +}); |
