Files
docx-js/src/file/table-of-contents/table-of-contents.spec.ts

27 lines
644 B
TypeScript
Raw Normal View History

2018-08-22 10:30:19 -03:00
import { expect } from "chai";
2018-08-29 12:06:01 -03:00
import { Formatter } from "../../export/formatter";
import { TableOfContents } from "./";
const DEFAULT_TOC = {
"w:std": {
"w:sdtPr": {},
"w:sdtEndPr": {},
"w:sdtContent": {
"w:p": {
"w:pPr": {},
},
},
},
};
2018-08-22 10:30:19 -03:00
describe("Table of Contents", () => {
2018-08-29 12:06:01 -03:00
describe("#constructor", () => {
it("should construct a TOC with default options", () => {
const toc = new TableOfContents();
const tree = new Formatter().format(toc);
expect(tree).to.be.deep.equal(DEFAULT_TOC);
});
2018-08-22 10:30:19 -03:00
});
});