From c0654e048359aa7dfbc9d4be4527b9bed3a4447a Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Sat, 5 Jul 2014 19:56:43 +0100 Subject: Always write out table cells, even when empty --- tests/document-to-html.tests.js | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/document-to-html.tests.js b/tests/document-to-html.tests.js index e3f5532..3b3bd9b 100644 --- a/tests/document-to-html.tests.js +++ b/tests/document-to-html.tests.js @@ -198,7 +198,6 @@ describe('DocumentConverter', function() { }); test('docx table is converted to table in HTML', function() { - // TODO: test that empty cells are preserved var table = new documents.Table([ new documents.TableRow([ new documents.TableCell([paragraphOfText("Top left")]), @@ -220,6 +219,23 @@ describe('DocumentConverter', function() { }); }); + test('empty cells are preserved in table', function() { + var table = new documents.Table([ + new documents.TableRow([ + new documents.TableCell([paragraphOfText("")]), + new documents.TableCell([paragraphOfText("Top right")]) + ]) + ]); + var converter = new DocumentConverter(); + + return converter.convertToHtml(table).then(function(result) { + var expectedHtml = "" + + "" + + "

Top 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