diff --git a/src/renderer/src/components/terminal-pane/terminal-ime-xterm-midline-preedit-tail.test.ts b/src/renderer/src/components/terminal-pane/terminal-ime-xterm-midline-preedit-tail.test.ts index 53a7efc0071..7a3a2860bab 100644 --- a/src/renderer/src/components/terminal-pane/terminal-ime-xterm-midline-preedit-tail.test.ts +++ b/src/renderer/src/components/terminal-pane/terminal-ime-xterm-midline-preedit-tail.test.ts @@ -244,10 +244,12 @@ describe('mid-line composition renders the covered row tail after the preedit', const rig = openTerminal({ cursorWidth: 2 }) await rig.write('x'.repeat(80)) let preeditWidth = CELL_WIDTH_PX * 2 - vi.spyOn(HTMLElement.prototype, 'getBoundingClientRect').mockImplementation(function () { - const width = this.classList.contains('xterm-composition-preedit') ? preeditWidth : 0 - return DOMRect.fromRect({ height: CELL_HEIGHT_PX, width }) - }) + vi.spyOn(HTMLElement.prototype, 'getBoundingClientRect').mockImplementation( + function (this: HTMLElement) { + const width = this.classList.contains('xterm-composition-preedit') ? preeditWidth : 0 + return DOMRect.fromRect({ height: CELL_HEIGHT_PX, width }) + } + ) rig.compose('가')