Add footer tests and improve table documentation

This commit is contained in:
Dolan
2019-01-03 02:11:04 +00:00
parent b9465b2a20
commit 04ea2b2dc9
2 changed files with 42 additions and 11 deletions

View File

@ -0,0 +1,29 @@
import { expect } from "chai";
import * as sinon from "sinon";
import { FooterWrapper } from "./footer-wrapper";
import { Media } from "./media";
import { Paragraph } from "./paragraph";
import { Table } from "./table";
describe("FooterWrapper", () => {
describe("#addParagraph", () => {
it("should call the underlying footer's addParagraph", () => {
const file = new FooterWrapper(new Media(), 1);
const spy = sinon.spy(file.Footer, "addParagraph");
file.addParagraph(new Paragraph());
expect(spy.called).to.equal(true);
});
});
describe("#addTable", () => {
it("should call the underlying footer's addParagraph", () => {
const file = new FooterWrapper(new Media(), 1);
const spy = sinon.spy(file.Footer, "addTable");
file.addTable(new Table(1, 1));
expect(spy.called).to.equal(true);
});
});
});