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 = {
|
2018-08-31 10:22:40 -03:00
|
|
|
"w:p": [
|
|
|
|
{
|
|
|
|
"w:pPr": [],
|
2018-08-29 12:06:01 -03:00
|
|
|
},
|
2018-09-03 10:48:50 -03:00
|
|
|
{
|
|
|
|
"w:r": [
|
|
|
|
{
|
|
|
|
"w:fldChar": [],
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
2018-08-31 10:22:40 -03:00
|
|
|
],
|
2018-08-29 12:06:01 -03:00
|
|
|
};
|
|
|
|
|
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
|
|
|
});
|
|
|
|
});
|