aboutsummaryrefslogtreecommitdiff
path: root/tests/docx-reader.tests.js
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2014-03-18 14:15:33 +0000
committerMichael Williamson <mike@zwobble.org>2014-03-18 14:15:33 +0000
commit45f302766a3a5ca99338fd8e5fef07dec42c0e56 (patch)
treee5081b43310e6c3698c08ab021e0d61d0a84d09c /tests/docx-reader.tests.js
parentdca50ccd84f91a7db2a41a59e15b3ed95b2c3f46 (diff)
Move modules for docx reading into separate directory
Diffstat (limited to 'tests/docx-reader.tests.js')
-rw-r--r--tests/docx-reader.tests.js43
1 files changed, 0 insertions, 43 deletions
diff --git a/tests/docx-reader.tests.js b/tests/docx-reader.tests.js
deleted file mode 100644
index 4fc487f..0000000
--- a/tests/docx-reader.tests.js
+++ /dev/null
@@ -1,43 +0,0 @@
-var assert = require("assert");
-
-var docxReader = require("../lib/docx-reader");
-var documents = require("../lib/documents");
-var XmlElement = require("../lib/xmlreader").Element;
-
-var testing = require("./testing");
-var test = testing.test;
-var testData = testing.testData;
-var createFakeDocxFile = testing.createFakeDocxFile;
-
-
-describe("docx-reader", function() {
- test("can read document with single paragraph with single run of text", function() {
- var expectedDocument = documents.Document([
- documents.Paragraph([
- documents.Run([
- documents.Text("Hello.")
- ])
- ])
- ]);
- var docxFile = createFakeDocxFile({
- "word/document.xml": testData("simple/word/document.xml")
- });
- return docxReader.read({file: docxFile}).then(function(result) {
- assert.deepEqual(expectedDocument, result.document);
- });
- });
-
- test("hyperlink hrefs are read from relationships file", function() {
- var docxFile = createFakeDocxFile({
- "word/document.xml": testData("hyperlinks/word/document.xml"),
- "word/_rels/document.xml.rels": testData("hyperlinks/word/_rels/document.xml.rels")
- });
- return docxReader.read({file: docxFile}).then(function(result) {
- var paragraph = result.document.children[0];
- assert.equal(1, paragraph.children.length);
- var hyperlink = paragraph.children[0];
- assert.equal(hyperlink.href, "http://www.example.com");
- assert.equal(hyperlink.children.length, 1);
- });
- });
-});