docx
Version:
Easily generate .docx files with JS/TS with a nice declarative API. Works for Node and on the Browser.
35 lines (28 loc) • 1.03 kB
text/typescript
import { expect } from "chai";
import { Formatter } from "export/formatter";
import { LatentStyleException } from "./exceptions";
import { LatentStyles } from "./latent-styles";
describe("LatentStyles", () => {
describe("#constructor()", () => {
it("should create", () => {
const currentLatentStyles = new LatentStyles();
const tree = new Formatter().format(currentLatentStyles);
expect(tree).to.deep.equal({
"w:latentStyles": {},
});
});
it("should create with exception", () => {
const currentLatentStyles = new LatentStyles(new LatentStyleException({}));
const tree = new Formatter().format(currentLatentStyles);
expect(tree).to.deep.equal({
"w:latentStyles": [
{
"w:lsdException": {
_attr: {},
},
},
],
});
});
});
});