aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2016-05-02 11:41:09 +0100
committerMichael Williamson <mike@zwobble.org>2016-05-02 11:41:09 +0100
commit245082a0c52ffcab818823ef4e33b89841fbf46d (patch)
treef45cde8ba2be07495831c85021c57480440f15fb /tests
parent1b54156c52caf3f2e9fe7eef29ba5ce6bd098ded (diff)
Add support for table cells spanning multiple columns
Diffstat (limited to 'tests')
-rw-r--r--tests/document-to-html.tests.js17
1 files changed, 17 insertions, 0 deletions
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 = "<table>" +
+ "<tr><td colspan=\"2\"><p>Top left</p></td><td><p>Top right</p></td></tr>" +
+ "</table>";
+ assert.equal(result.value, expectedHtml);
+ });
+ });
+
test('line break is converted to <br>', function() {
var lineBreak = new documents.LineBreak();
var converter = new DocumentConverter();