diff options
| author | Michael Williamson <mike@zwobble.org> | 2013-03-30 22:26:18 +0000 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2013-03-30 22:26:18 +0000 |
| commit | 099c86ab5fabea429eb226fbff179f0317ec755c (patch) | |
| tree | 7d633240cc4c8de39da667bab1d9aaf6584a3701 /tests/docx-reader.tests.js | |
| parent | c127f0d75175d2ab06682bac1bb22dcf31de2b81 (diff) | |
Read style names from paragraph properties
Diffstat (limited to 'tests/docx-reader.tests.js')
| -rw-r--r-- | tests/docx-reader.tests.js | 20 |
1 files changed, 20 insertions, 0 deletions
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); + }); + }); }); |
