2019-03-05 17:17:06 +01:00
|
|
|
import { expect } from "chai";
|
|
|
|
import { Formatter } from "export/formatter";
|
|
|
|
|
2019-04-10 13:47:38 -04:00
|
|
|
import { EMPTY_OBJECT } from "file/xml-components";
|
|
|
|
|
2021-02-27 01:40:55 +00:00
|
|
|
import { Compatibility } from "./compatibility";
|
|
|
|
|
2019-03-05 17:17:06 +01:00
|
|
|
describe("Compatibility", () => {
|
|
|
|
describe("#constructor", () => {
|
|
|
|
it("creates an initially empty property object", () => {
|
2021-02-27 01:40:55 +00:00
|
|
|
const compatibility = new Compatibility({});
|
2019-03-05 17:17:06 +01:00
|
|
|
|
|
|
|
const tree = new Formatter().format(compatibility);
|
2019-04-10 13:47:38 -04:00
|
|
|
expect(tree).to.deep.equal({ "w:compat": EMPTY_OBJECT });
|
2019-03-05 17:17:06 +01:00
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
describe("#doNotExpandShiftReturn", () => {
|
|
|
|
it("should create a setting for not justifying lines ending in soft line break", () => {
|
2021-02-27 01:40:55 +00:00
|
|
|
const compatibility = new Compatibility({
|
|
|
|
doNotExpandShiftReturn: true,
|
|
|
|
});
|
2019-03-05 17:17:06 +01:00
|
|
|
|
|
|
|
const tree = new Formatter().format(compatibility);
|
2019-04-10 13:47:38 -04:00
|
|
|
expect(tree).to.deep.equal({ "w:compat": [{ "w:doNotExpandShiftReturn": EMPTY_OBJECT }] });
|
2019-03-05 17:17:06 +01:00
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|