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:
@ -4,6 +4,8 @@ import { Formatter } from "export/formatter";
|
||||
|
||||
import { GridCol, TableGrid } from "./grid";
|
||||
|
||||
import { EMPTY_OBJECT } from "file/xml-components";
|
||||
|
||||
describe("GridCol", () => {
|
||||
describe("#constructor", () => {
|
||||
it("sets the width attribute to the value given", () => {
|
||||
@ -17,7 +19,7 @@ describe("GridCol", () => {
|
||||
it("does not set a width attribute if not given", () => {
|
||||
const grid = new GridCol();
|
||||
const tree = new Formatter().format(grid);
|
||||
expect(tree).to.deep.equal({ "w:gridCol": {} });
|
||||
expect(tree).to.deep.equal({ "w:gridCol": EMPTY_OBJECT });
|
||||
});
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user