#627 Add footnotes relationships
This commit is contained in:
@ -1,50 +1,16 @@
|
||||
import { expect } from "chai";
|
||||
import * as sinon from "sinon";
|
||||
|
||||
import { FooterWrapper } from "./footer-wrapper";
|
||||
import { Media } from "./media";
|
||||
import { Paragraph } from "./paragraph";
|
||||
import { Table, TableCell, TableRow } from "./table";
|
||||
import { DocumentWrapper } from "./document-wrapper";
|
||||
|
||||
describe("FooterWrapper", () => {
|
||||
describe("#add", () => {
|
||||
it("should call the underlying footer's addParagraph", () => {
|
||||
const file = new FooterWrapper(new Media(), 1);
|
||||
const spy = sinon.spy(file.View, "add");
|
||||
file.add(new Paragraph({}));
|
||||
describe("DocumentWrapper", () => {
|
||||
describe("#constructor", () => {
|
||||
it("should create", () => {
|
||||
const file = new DocumentWrapper({ background: {} });
|
||||
|
||||
expect(spy.called).to.equal(true);
|
||||
});
|
||||
|
||||
it("should call the underlying footer's addParagraph", () => {
|
||||
const file = new FooterWrapper(new Media(), 1);
|
||||
const spy = sinon.spy(file.View, "add");
|
||||
file.add(
|
||||
new Table({
|
||||
rows: [
|
||||
new TableRow({
|
||||
children: [
|
||||
new TableCell({
|
||||
children: [new Paragraph("hello")],
|
||||
}),
|
||||
],
|
||||
}),
|
||||
],
|
||||
}),
|
||||
);
|
||||
|
||||
expect(spy.called).to.equal(true);
|
||||
});
|
||||
});
|
||||
|
||||
describe("#addChildElement", () => {
|
||||
it("should call the underlying footer's addChildElement", () => {
|
||||
const file = new FooterWrapper(new Media(), 1);
|
||||
const spy = sinon.spy(file.View, "addChildElement");
|
||||
// tslint:disable-next-line:no-any
|
||||
file.addChildElement({} as any);
|
||||
|
||||
expect(spy.called).to.equal(true);
|
||||
// tslint:disable-next-line: no-unused-expression
|
||||
expect(file.View).to.be.ok;
|
||||
// tslint:disable-next-line: no-unused-expression
|
||||
expect(file.Relationships).to.be.ok;
|
||||
});
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user