Added constant EMPTY_OBJECT (an empty sealed object) that is used to indicate to the xml
library that an empty XML element should be generated, and use it in the JSON hardcoded into the tests.
This commit is contained in:
@ -5,13 +5,15 @@ import { Formatter } from "export/formatter";
|
||||
import { TableCell } from "../table-cell";
|
||||
import { TableRow } from "./table-row";
|
||||
|
||||
import { EMPTY_OBJECT } from "file/xml-components";
|
||||
|
||||
describe("TableRow", () => {
|
||||
describe("#constructor", () => {
|
||||
it("should create with no cells", () => {
|
||||
const tableRow = new TableRow([]);
|
||||
const tree = new Formatter().format(tableRow);
|
||||
expect(tree).to.deep.equal({
|
||||
"w:tr": {},
|
||||
"w:tr": EMPTY_OBJECT,
|
||||
});
|
||||
});
|
||||
|
||||
@ -23,7 +25,7 @@ describe("TableRow", () => {
|
||||
{
|
||||
"w:tc": [
|
||||
{
|
||||
"w:p": {},
|
||||
"w:p": EMPTY_OBJECT,
|
||||
},
|
||||
],
|
||||
},
|
||||
|
Reference in New Issue
Block a user