From 099c86ab5fabea429eb226fbff179f0317ec755c Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Sat, 30 Mar 2013 22:26:18 +0000 Subject: Read style names from paragraph properties --- tests/docx-reader.tests.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'tests/docx-reader.tests.js') diff --git a/tests/docx-reader.tests.js b/tests/docx-reader.tests.js index b7e1c29..c486f3b 100644 --- a/tests/docx-reader.tests.js +++ b/tests/docx-reader.tests.js @@ -25,4 +25,24 @@ describe("docx-reader", function() { assert.deepEqual(expectedDocument, result); }); }); + + test("can read paragraph styles", function() { + var docxFile = createFakeDocxFile({ + "word/document.xml": testData("paragraphStyles/word/document.xml") + }); + return docxReader.read(docxFile).then(function(result) { + var paragraph = result.children[0]; + assert.deepEqual({styleName: "Heading1"}, paragraph.properties); + }); + }); + + test("paragraph properties are not included as child of paragraph", function() { + var docxFile = createFakeDocxFile({ + "word/document.xml": testData("paragraphStyles/word/document.xml") + }); + return docxReader.read(docxFile).then(function(result) { + var paragraph = result.children[0]; + assert.equal(1, paragraph.children.length); + }); + }); }); -- cgit v1.2.3