From 8aec6e713d08a532194b50591fa338ecb9a251f9 Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Tue, 10 Jun 2014 16:23:15 +0100 Subject: Basic support for footnotes --- tests/docx/footnotes-reader.tests.js | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) (limited to 'tests/docx/footnotes-reader.tests.js') 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"); }); }); -- cgit v1.2.3