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) <noreply@anthropic.com>
This commit is contained in:
Codeman maintainer
2026-10-07 09:37:04 +02:00
parent c101b70678
commit 17eea3c230
+7 -1
View File
@@ -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();');