Add tests

This commit is contained in:
Dolan
2018-12-16 01:56:42 +00:00
parent a1c21d2143
commit 0725e54271
4 changed files with 59 additions and 6 deletions

View File

@ -9,9 +9,9 @@ import { Table } from "./table";
describe("HeaderWrapper", () => {
describe("#addParagraph", () => {
it("should call the underlying header's addParagraph", () => {
const file = new HeaderWrapper(new Media(), 1);
const spy = sinon.spy(file.Header, "addParagraph");
file.addParagraph(new Paragraph());
const wrapper = new HeaderWrapper(new Media(), 1);
const spy = sinon.spy(wrapper.Header, "addParagraph");
wrapper.addParagraph(new Paragraph());
expect(spy.called).to.equal(true);
});
@ -19,9 +19,9 @@ describe("HeaderWrapper", () => {
describe("#addTable", () => {
it("should call the underlying header's addParagraph", () => {
const file = new HeaderWrapper(new Media(), 1);
const spy = sinon.spy(file.Header, "addTable");
file.addTable(new Table(1, 1));
const wrapper = new HeaderWrapper(new Media(), 1);
const spy = sinon.spy(wrapper.Header, "addTable");
wrapper.addTable(new Table(1, 1));
expect(spy.called).to.equal(true);
});