summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2015-01-19 19:47:41 +0000
committerMichael Williamson <mike@zwobble.org>2015-01-19 19:47:41 +0000
commit5a0b91e72fc89695fcb92ed5306587a64570ddd0 (patch)
tree4c91de1b5f45064a7a10204a6437931c3ffaa5cf
parent9041dfcc4fe8fc28e7772505e5da8d9d71e2ce56 (diff)
Add disabled test for endnotes
-rw-r--r--tests/mammoth.tests.js18
-rw-r--r--tests/test-data/endnotes.docxbin0 -> 4253 bytes
2 files changed, 18 insertions, 0 deletions
diff --git a/tests/mammoth.tests.js b/tests/mammoth.tests.js
index 32bc281..08649f4 100644
--- a/tests/mammoth.tests.js
+++ b/tests/mammoth.tests.js
@@ -164,6 +164,24 @@ describe('mammoth', function() {
});
});
+ test('endnotes are appended to text', function() {
+ return;
+ var docxPath = path.join(__dirname, "test-data/endnotes.docx");
+ var options = {
+ generateUniquifier: function() { return 42; }
+ };
+ return mammoth.convertToHtml({path: docxPath}, options).then(function(result) {
+ var expectedOutput = '<p>Ouch' +
+ '<sup><a href="#endnote-42-1" id="endnote-ref-42-1">[1]</a></sup>.' +
+ '<sup><a href="#endnote-42-2" id="endnote-ref-42-2">[2]</a></sup></p>' +
+ '<ol><li id="endnote-42-1"><p> A tachyon walks into a bar. <a href="#endnote-ref-42-1">↑</a></p></li>' +
+ '<li id="endnote-42-2"><p> Fin. <a href="#endnote-ref-42-2">↑</a></p></li></ol>';
+ assert.equal(result.value, expectedOutput);
+ // TODO: get rid of warnings
+ //~ assert.deepEqual(result.messages, []);
+ });
+ });
+
test('indentation is used if prettyPrint is true', function() {
var docxPath = path.join(__dirname, "test-data/single-paragraph.docx");
return mammoth.convertToHtml({path: docxPath}, {prettyPrint: true}).then(function(result) {
diff --git a/tests/test-data/endnotes.docx b/tests/test-data/endnotes.docx
new file mode 100644
index 0000000..5ec7faf
--- /dev/null
+++ b/tests/test-data/endnotes.docx
Binary files differ