From 751dbebcf1ac041c67bf126e76d4368f6cb062aa Mon Sep 17 00:00:00 2001 From: Neil <4138956+nwparker@users.noreply.github.com> Date: Sat, 29 Aug 2026 14:59:27 -0700 Subject: [PATCH] test(terminal): type final-cell layout mock --- .../terminal-ime-xterm-midline-preedit-tail.test.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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('가')