From 7c82c1a81559553aa670482f90ff931931db65e2 Mon Sep 17 00:00:00 2001 From: Per Bothner Date: Sun, 31 May 2026 09:48:19 -0700 Subject: [PATCH] Update more DecorationService tests to use existing bufferService. --- src/common/services/DecorationService.test.ts | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/src/common/services/DecorationService.test.ts b/src/common/services/DecorationService.test.ts index ec86a85f3..51d020576 100644 --- a/src/common/services/DecorationService.test.ts +++ b/src/common/services/DecorationService.test.ts @@ -94,18 +94,16 @@ describe('DecorationService', () => { }); it('should find multi-line decoration when single-line decorations exist on other lines', () => { - const bufferService = new MockBufferService(80, 24, new MockOptionsService()); - const serviceWithBuffer = new DecorationService(new MockLogService(), bufferService); const buffer = bufferService.buffer; (buffer as Buffer).fillViewportRows(); for (let i = 0; i < buffer.lines.length; i++) { - serviceWithBuffer.registerDecoration({ + service.registerDecoration({ marker: buffer.addMarker(i), width: 5 }); } - const multiLine = serviceWithBuffer.registerDecoration({ + const multiLine = service.registerDecoration({ marker: buffer.addMarker(10), width: 10, height: 3 @@ -113,7 +111,7 @@ describe('DecorationService', () => { assert.ok(multiLine); const found: typeof multiLine[] = []; - serviceWithBuffer.forEachDecorationAtCell(0, 11, undefined, d => found.push(d)); + service.forEachDecorationAtCell(0, 11, undefined, d => found.push(d)); assert.include(found, multiLine); }); }); @@ -143,8 +141,6 @@ describe('DecorationService', () => { describe('line index maintenance', () => { it('should keep lookups correct after buffer trim', () => { - const bufferService = new MockBufferService(80, 5, new MockOptionsService({ scrollback: 0 })); - const service = new DecorationService(new MockLogService(), bufferService); const buffer = bufferService.buffer; (buffer as Buffer).fillViewportRows(); @@ -160,8 +156,6 @@ describe('DecorationService', () => { }); it('should remove decoration from line index when marker is trimmed off buffer', () => { - const bufferService = new MockBufferService(80, 5, new MockOptionsService({ scrollback: 0 })); - const service = new DecorationService(new MockLogService(), bufferService); const buffer = bufferService.buffer; (buffer as Buffer).fillViewportRows(); @@ -179,8 +173,6 @@ describe('DecorationService', () => { }); it('should keep multi-line decoration indexed after line insert', async () => { - const bufferService = new MockBufferService(80, 10, new MockOptionsService({ scrollback: 100 })); - const service = new DecorationService(new MockLogService(), bufferService); const buffer = bufferService.buffer; (buffer as Buffer).fillViewportRows();