docx
Version:
Easily generate .docx files with JS/TS with a nice declarative API. Works for Node and on the Browser.
29 lines (22 loc) • 984 B
text/typescript
import { expect } from "chai";
import { Formatter } from "export/formatter";
import { EMPTY_OBJECT } from "file/xml-components";
import { Compatibility } from "./compatibility";
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": EMPTY_OBJECT });
});
});
describe("#doNotExpandShiftReturn", () => {
it("should create a setting for not justifying lines ending in soft line break", () => {
const compatibility = new Compatibility({
doNotExpandShiftReturn: true,
});
const tree = new Formatter().format(compatibility);
expect(tree).to.deep.equal({ "w:compat": [{ "w:doNotExpandShiftReturn": EMPTY_OBJECT }] });
});
});
});