Add tests to patcher

This commit is contained in:
Dolan Miu
2023-03-16 01:55:18 +00:00
parent 262f6323d0
commit 7e9884081e
11 changed files with 447 additions and 81 deletions

View File

@ -70,5 +70,96 @@ describe("paragraph-token-replacer", () => {
name: "w:p",
});
});
// Try to fill rest of test coverage
// it("should replace token in paragraph", () => {
// const output = replaceTokenInParagraphElement({
// paragraphElement: {
// name: "w:p",
// elements: [
// {
// name: "w:r",
// elements: [
// {
// name: "w:t",
// elements: [
// {
// type: "text",
// text: "test ",
// },
// ],
// },
// {
// name: "w:t",
// elements: [
// {
// type: "text",
// text: " hello ",
// },
// ],
// },
// ],
// },
// ],
// },
// renderedParagraph: {
// index: 0,
// path: [0],
// runs: [
// {
// end: 4,
// index: 0,
// parts: [
// {
// end: 4,
// index: 0,
// start: 0,
// text: "test ",
// },
// ],
// start: 0,
// text: "test ",
// },
// {
// end: 10,
// index: 0,
// parts: [
// {
// end: 10,
// index: 0,
// start: 5,
// text: "hello ",
// },
// ],
// start: 5,
// text: "hello ",
// },
// ],
// text: "test hello ",
// },
// originalText: "hello",
// replacementText: "world",
// });
// expect(output).to.deep.equal({
// elements: [
// {
// elements: [
// {
// elements: [
// {
// text: "test world ",
// type: "text",
// },
// ],
// name: "w:t",
// },
// ],
// name: "w:r",
// },
// ],
// name: "w:p",
// });
// });
});
});