From 17eea3c2302c0a50a9a4578b2aa0461441df15fc Mon Sep 17 00:00:00 2001 From: Codeman maintainer Date: Wed, 7 Oct 2026 03:58:21 +0200 Subject: [PATCH] test(tiles): the connect() static guard's end anchor resolves again terminal-tile-unit slices connect() out of terminal-tile.js up to 'async _loadBuffer()'. The load queue commit (fca7acd0) gave _loadBuffer a `{ refresh }` parameter, so that anchor stopped matching, indexOf returned -1 and the slice ran to the end of the file: every check in the test passed against code outside connect(). The anchor is now 'async _loadBuffer(' and the test asserts both anchors resolve, so a rename fails it instead of widening it (checked by putting the old anchor back). Co-Authored-By: Claude Opus 5.5 (1M context) --- test/terminal-tile-unit.test.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/test/terminal-tile-unit.test.ts b/test/terminal-tile-unit.test.ts index 07a46294..5606abf2 100644 --- a/test/terminal-tile-unit.test.ts +++ b/test/terminal-tile-unit.test.ts @@ -792,7 +792,13 @@ describe('TerminalTile scroll-to-top history pull', () => { it('connect() installs the wheel listener (static guard)', () => { // connect() needs a whole xterm to run, so its wiring is pinned by source // rather than executed; the listener's behaviour is exercised above. - const connect = SOURCE.slice(SOURCE.indexOf('async connect()'), SOURCE.indexOf('async _loadBuffer()')); + const start = SOURCE.indexOf('async connect()'); + const end = SOURCE.indexOf('async _loadBuffer('); + // Both anchors must resolve, or the slice runs to the end of the file and + // every check below passes against code outside connect(). + expect(start).toBeGreaterThan(-1); + expect(end).toBeGreaterThan(start); + const connect = SOURCE.slice(start, end); expect(connect).toContain('this._installWheelListener();'); expect(connect).toContain('this._onLiveClear();'); expect(connect).not.toContain('this.terminal.clear();');