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:
@ -2,13 +2,15 @@ import { expect } from "chai";
|
||||
import { Formatter } from "export/formatter";
|
||||
import { Compatibility } from "file/settings/compatibility";
|
||||
|
||||
import { EMPTY_OBJECT } from "file/xml-components";
|
||||
|
||||
describe("Compatibility", () => {
|
||||
describe("#constructor", () => {
|
||||
it("creates an initially empty property object", () => {
|
||||
const compatibility = new Compatibility();
|
||||
|
||||
const tree = new Formatter().format(compatibility);
|
||||
expect(tree).to.deep.equal({ "w:compat": {} });
|
||||
expect(tree).to.deep.equal({ "w:compat": EMPTY_OBJECT });
|
||||
});
|
||||
});
|
||||
|
||||
@ -18,7 +20,7 @@ describe("Compatibility", () => {
|
||||
compatibility.doNotExpandShiftReturn();
|
||||
|
||||
const tree = new Formatter().format(compatibility);
|
||||
expect(tree).to.deep.equal({ "w:compat": [{ "w:doNotExpandShiftReturn": {} }] });
|
||||
expect(tree).to.deep.equal({ "w:compat": [{ "w:doNotExpandShiftReturn": EMPTY_OBJECT }] });
|
||||
});
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user