From 7afa4ee3dc69db4e7df6f8669c503261bf76c50e Mon Sep 17 00:00:00 2001 From: Brennan Benson <79079362+brennanb2025@users.noreply.github.com> Date: Wed, 30 Sep 2026 00:45:33 -0700 Subject: [PATCH] test(e2e): read the tab strip's dock samples through a typed window field (#24052) #24010's spec read them with Reflect.get, which the low-evidence lint rejects, so every PR's static analysis now fails on main. --- tests/e2e/tab-strip-active-dock.spec.ts | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) 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.