Use context in prep xml

This commit is contained in:
Dolan
2021-03-11 01:06:55 +00:00
parent cf6c4998d0
commit 566ac03f9a
16 changed files with 216 additions and 87 deletions

View File

@ -6,6 +6,7 @@ import { Formatter } from "export/formatter";
import { EMPTY_OBJECT } from "file/xml-components";
import { IViewWrapper } from "../document-wrapper";
import { File } from "../file";
import { ShadingType } from "../table/shading";
import { AlignmentType, HeadingLevel, LeaderType, PageBreak, TabStopPosition, TabStopType } from "./formatting";
import { Bookmark, ExternalHyperlink } from "./links";
@ -830,12 +831,17 @@ describe("Paragraph", () => {
}),
],
});
const fileMock = ({
const viewWrapperMock = ({
Relationships: {
createRelationship: () => ({}),
},
} as unknown) as IViewWrapper;
paragraph.prepForXml(fileMock);
const file = ({} as unknown) as File;
paragraph.prepForXml({
viewWrapper: viewWrapperMock,
file: file,
});
const tree = new Formatter().format(paragraph);
expect(tree).to.deep.equal({
"w:p": [