import { assert, expect } from "chai"; import { Formatter } from "export/formatter"; import { ThematicBreak } from "./border"; describe("Border", () => { // TODO: Need tests here }); describe("ThematicBreak", () => { let thematicBreak: ThematicBreak; beforeEach(() => { thematicBreak = new ThematicBreak(); }); describe("#constructor()", () => { it("should create valid JSON", () => { const stringifiedJson = JSON.stringify(thematicBreak); try { JSON.parse(stringifiedJson); } catch (e) { assert.isTrue(false); } assert.isTrue(true); }); it("should create a Thematic Break with correct border properties", () => { const tree = new Formatter().format(thematicBreak); expect(tree).to.deep.equal({ "w:pBdr": [ { "w:bottom": { _attr: { "w:color": "auto", "w:space": 1, "w:sz": 6, "w:val": "single", }, }, }, ], }); }); }); });