Add tests
This commit is contained in:
@ -1,8 +1,11 @@
|
||||
import { expect } from "chai";
|
||||
import * as sinon from "sinon";
|
||||
|
||||
import { Formatter } from "export/formatter";
|
||||
|
||||
import { File } from "./file";
|
||||
import { Paragraph } from "./paragraph";
|
||||
import { Table } from "./table";
|
||||
|
||||
describe("File", () => {
|
||||
describe("#constructor", () => {
|
||||
@ -55,4 +58,24 @@ describe("File", () => {
|
||||
expect(tree["w:body"][1]["w:sectPr"][9]["w:footerReference"][0]._attr["w:type"]).to.equal("even");
|
||||
});
|
||||
});
|
||||
|
||||
describe("#addParagraph", () => {
|
||||
it("should call the underlying header's addParagraph", () => {
|
||||
const file = new File();
|
||||
const spy = sinon.spy(file.Document, "addParagraph");
|
||||
file.addParagraph(new Paragraph());
|
||||
|
||||
expect(spy.called).to.equal(true);
|
||||
});
|
||||
});
|
||||
|
||||
describe("#addTable", () => {
|
||||
it("should call the underlying header's addParagraph", () => {
|
||||
const wrapper = new File();
|
||||
const spy = sinon.spy(wrapper.Document, "addTable");
|
||||
wrapper.addTable(new Table(1, 1));
|
||||
|
||||
expect(spy.called).to.equal(true);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user