diff --git a/src/patcher/paragraph-split-inject.spec.ts b/src/patcher/paragraph-split-inject.spec.ts index 5228a88d2d..c0b8eec459 100644 --- a/src/patcher/paragraph-split-inject.spec.ts +++ b/src/patcher/paragraph-split-inject.spec.ts @@ -86,6 +86,29 @@ describe("paragraph-split-inject", () => { ), ).to.throw(); }); + + it("should continue if text run doesn't have text", () => { + const output = findRunElementIndexWithToken( + { + name: "w:p", + type: "element", + elements: [ + { + name: "w:r", + type: "element", + elements: [ + { + name: "w:t", + type: "element", + }, + ], + }, + ], + }, + "hello", + ); + expect(output).to.deep.equal(0); + }); }); describe("splitRunElement", () => {