Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions tests/e2e/tab-strip-active-dock.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}"]`
}
Expand Down Expand Up @@ -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) }
)
Expand All @@ -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.
Expand Down
Loading