From 377e08477c8dce941b2d1504899123274e0c3e80 Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Sat, 5 Jul 2014 19:45:24 +0100 Subject: Add conversion of tables to HTML --- tests/document-to-html.tests.js | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'tests') diff --git a/tests/document-to-html.tests.js b/tests/document-to-html.tests.js index cfd1c20..ead267b 100644 --- a/tests/document-to-html.tests.js +++ b/tests/document-to-html.tests.js @@ -197,6 +197,28 @@ describe('DocumentConverter', function() { }); }); + test('docx table is converted to table in HTML', function() { + var table = new documents.Table([ + new documents.TableRow([ + new documents.TableCell([paragraphOfText("Top left")]), + new documents.TableCell([paragraphOfText("Top right")]) + ]), + new documents.TableRow([ + new documents.TableCell([paragraphOfText("Bottom left")]), + new documents.TableCell([paragraphOfText("Bottom right")]) + ]) + ]); + var converter = new DocumentConverter(); + + return converter.convertToHtml(table).then(function(result) { + var expectedHtml = "" + + "" + + "" + + "

Top left

Top right

Bottom left

Bottom right

"; + assert.equal(result.value, expectedHtml); + }); + }); + test('footnote reference is converted to superscript intra-page link', function() { var footnoteReference = new documents.FootnoteReference({ footnoteId: "4", -- cgit v1.2.3