From c5eb3d567083b1571452615c057e17145a611c5f Mon Sep 17 00:00:00 2001 From: Dolan Date: Thu, 26 Sep 2019 02:24:43 +0100 Subject: [PATCH] Add addMargin test --- .../table-cell/table-cell-properties.spec.ts | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/src/file/table/table-cell/table-cell-properties.spec.ts b/src/file/table/table-cell/table-cell-properties.spec.ts index 9835aa9623..c3452e757c 100644 --- a/src/file/table/table-cell/table-cell-properties.spec.ts +++ b/src/file/table/table-cell/table-cell-properties.spec.ts @@ -73,6 +73,54 @@ describe("TableCellProperties", () => { }); }); + describe("#addMargins", () => { + it("sets shading", () => { + const properties = new TableCellProperties(); + properties.addMargins({}); + const tree = new Formatter().format(properties); + expect(tree).to.deep.equal({ + "w:tcPr": [ + { + "w:tcMar": [ + { + "w:top": { + _attr: { + "w:type": "dxa", + "w:w": 0, + }, + }, + }, + { + "w:bottom": { + _attr: { + "w:type": "dxa", + "w:w": 0, + }, + }, + }, + { + "w:end": { + _attr: { + "w:type": "dxa", + "w:w": 0, + }, + }, + }, + { + "w:start": { + _attr: { + "w:type": "dxa", + "w:w": 0, + }, + }, + }, + ], + }, + ], + }); + }); + }); + describe("#Borders", () => { it("should return the TableCellBorders if Border has borders", () => { const properties = new TableCellProperties();