From b2de74a0e6c1392b842368d4cff88c8b5112ec41 Mon Sep 17 00:00:00 2001 From: Dolan Miu Date: Wed, 25 Sep 2019 01:09:53 +0100 Subject: [PATCH] Fix tests --- src/file/table/table.spec.ts | 45 +++++++++++++++++++++++++++++++++--- 1 file changed, 42 insertions(+), 3 deletions(-) diff --git a/src/file/table/table.spec.ts b/src/file/table/table.spec.ts index efbf2ebb24..b88bda964a 100644 --- a/src/file/table/table.spec.ts +++ b/src/file/table/table.spec.ts @@ -8,7 +8,6 @@ import { Table } from "./table"; // import { WidthType } from "./table-cell"; import { RelativeHorizontalPosition, RelativeVerticalPosition, TableAnchorType } from "./table-properties"; -import { EMPTY_OBJECT } from "file/xml-components"; import { TableCell } from "./table-cell"; import { TableLayoutType } from "./table-properties/table-layout"; import { TableRow } from "./table-row"; @@ -154,7 +153,28 @@ describe("Table", () => { ], }); const tree = new Formatter().format(table); - const cell = { "w:tc": [{ "w:p": EMPTY_OBJECT }] }; + const cell = { + "w:tc": [ + { + "w:p": [ + { + "w:r": [ + { + "w:t": [ + { + _attr: { + "xml:space": "preserve", + }, + }, + "hello", + ], + }, + ], + }, + ], + }, + ], + }; expect(tree).to.deep.equal({ "w:tbl": [ { "w:tblPr": [DEFAULT_TABLE_PROPERTIES, BORDERS, WIDTHS] }, @@ -216,7 +236,26 @@ describe("Table", () => { .to.be.an("array") .which.has.length.at.least(1); expect(row["w:tr"].find((x) => x["w:tc"])).to.deep.equal({ - "w:tc": [{ "w:p": EMPTY_OBJECT }], + "w:tc": [ + { + "w:p": [ + { + "w:r": [ + { + "w:t": [ + { + _attr: { + "xml:space": "preserve", + }, + }, + "hello", + ], + }, + ], + }, + ], + }, + ], }); });