test(terminal): type final-cell layout mock

This commit is contained in:
Neil
2026-08-29 14:59:27 -07:00
parent 1ec21ddf50
commit 751dbebcf1
@@ -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('가')