Files
docx-js/src/file/header-wrapper.spec.ts

30 lines
965 B
TypeScript
Raw Normal View History

2018-11-01 02:22:32 +00:00
import { expect } from "chai";
import * as sinon from "sinon";
import { HeaderWrapper } from "./header-wrapper";
import { Media } from "./media";
import { Paragraph } from "./paragraph";
import { Table } from "./table";
describe("HeaderWrapper", () => {
describe("#addParagraph", () => {
it("should call the underlying header's addParagraph", () => {
2018-12-16 01:56:42 +00:00
const wrapper = new HeaderWrapper(new Media(), 1);
const spy = sinon.spy(wrapper.Header, "addParagraph");
wrapper.addParagraph(new Paragraph());
2018-11-01 02:22:32 +00:00
expect(spy.called).to.equal(true);
});
});
describe("#addTable", () => {
it("should call the underlying header's addParagraph", () => {
2018-12-16 01:56:42 +00:00
const wrapper = new HeaderWrapper(new Media(), 1);
const spy = sinon.spy(wrapper.Header, "addTable");
wrapper.addTable(new Table(1, 1));
2018-11-01 02:22:32 +00:00
expect(spy.called).to.equal(true);
});
});
});