From 245082a0c52ffcab818823ef4e33b89841fbf46d Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Mon, 2 May 2016 11:41:09 +0100 Subject: Add support for table cells spanning multiple columns --- tests/document-to-html.tests.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'tests') diff --git a/tests/document-to-html.tests.js b/tests/document-to-html.tests.js index 7760b17..3fcb49e 100644 --- a/tests/document-to-html.tests.js +++ b/tests/document-to-html.tests.js @@ -400,6 +400,23 @@ describe('DocumentConverter', function() { }); }); + test('table cells are written with colSpan if not equal to one', function() { + var table = new documents.Table([ + new documents.TableRow([ + new documents.TableCell([paragraphOfText("Top left")], {colSpan: 2}), + new documents.TableCell([paragraphOfText("Top right")]) + ]) + ]); + var converter = new DocumentConverter(); + + return converter.convertToHtml(table).then(function(result) { + var expectedHtml = "" + + "" + + "

Top left

Top right

"; + assert.equal(result.value, expectedHtml); + }); + }); + test('line break is converted to
', function() { var lineBreak = new documents.LineBreak(); var converter = new DocumentConverter(); -- cgit v1.2.3