diff --git a/tests/e2e/tab-strip-active-dock.spec.ts b/tests/e2e/tab-strip-active-dock.spec.ts index 0a3dbe09363..eaacd2ef4dc 100644 --- a/tests/e2e/tab-strip-active-dock.spec.ts +++ b/tests/e2e/tab-strip-active-dock.spec.ts @@ -15,6 +15,13 @@ const STRIP = '.terminal-tab-strip' type DockSample = { scrollLeft: number; activeLeft: number; activeRight: number } +declare global { + // oxlint-disable-next-line typescript-eslint/consistent-type-definitions -- declaration merging requires interface + interface Window { + __tabStripDockSamples?: DockSample[] + } +} + function slotSelector(tabId: string): string { return `${STRIP} > [data-tab-strip-slot="${tabId}"]` } @@ -120,7 +127,7 @@ test.describe('Tab strip active-tab dock', () => { requestAnimationFrame(sample) } requestAnimationFrame(sample) - Reflect.set(window, '__tabStripDockSamples', samples) + window.__tabStripDockSamples = samples }, { strip: STRIP, slot: slotSelector(lastTabId) } ) @@ -141,9 +148,7 @@ test.describe('Tab strip active-tab dock', () => { const finalScrollLeft = await strip.evaluate((el) => el.scrollLeft) expect(finalScrollLeft).toBeGreaterThan(0) const view = await readSlotViewportSpan(orcaPage, lastTabId) - const samples: DockSample[] = await orcaPage.evaluate(() => - Reflect.get(window, '__tabStripDockSamples') - ) + const samples = await orcaPage.evaluate(() => window.__tabStripDockSamples ?? []) expect(samples.length).toBeGreaterThan(0) for (const sample of samples) { // One jump from the docked position to the reveal; any value in between is visible scrolling.