diff options
| author | Michael Williamson <mike@zwobble.org> | 2014-06-10 16:23:15 +0100 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2014-06-10 16:23:15 +0100 |
| commit | 8aec6e713d08a532194b50591fa338ecb9a251f9 (patch) | |
| tree | 00004b0324527dac50add38cdf6ac39cec604227 /tests/docx/footnotes-reader.tests.js | |
| parent | ee2fc5da880df5f9ea8cdaebc506d130c3009ce3 (diff) | |
Basic support for footnotes
Diffstat (limited to 'tests/docx/footnotes-reader.tests.js')
| -rw-r--r-- | tests/docx/footnotes-reader.tests.js | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/tests/docx/footnotes-reader.tests.js b/tests/docx/footnotes-reader.tests.js index 536fc55..512f477 100644 --- a/tests/docx/footnotes-reader.tests.js +++ b/tests/docx/footnotes-reader.tests.js @@ -8,23 +8,15 @@ var test = require("../testing").test; describe('readFootnotesXml', function() { - test('footnote can be looked up by ID', function() { + test('ID and body of footnote are read', function() { var footnoteBody = [new XmlElement("w:p", {}, [])]; var footnotes = readFootnotesXml({ root: new XmlElement("w:footnotes", {}, [ new XmlElement("w:footnote", {"w:id": "1"}, footnoteBody) ]) }); - assert.strictEqual(footnotes.findFootnoteById("1").body, footnoteBody); - }); - - test('footnote is null if no footnote with that ID exists', function() { - var footnoteBody = [new XmlElement("w:p", {}, [])]; - var footnotes = readFootnotesXml({ - root: new XmlElement("w:footnotes", {}, [ - new XmlElement("w:footnote", {"w:id": "1"}, footnoteBody) - ]) - }); - assert.strictEqual(footnotes.findFootnoteById("2"), null); + assert.equal(footnotes.length, 1); + assert.strictEqual(footnotes[0].body, footnoteBody); + assert.deepEqual(footnotes[0].id, "1"); }); }); |
