(page: Page, index: number)
| 9 | } |
| 10 | |
| 11 | async function bounds(page: Page, index: number) { |
| 12 | return page.evaluate((index) => { |
| 13 | const list = document.querySelector('[role="list"]')!; |
| 14 | const row = list.querySelector(`[data-index="${index}"]`); |
| 15 | if (!row) return null; |
| 16 | const viewport = list.getBoundingClientRect(); |
| 17 | const rect = row.getBoundingClientRect(); |
| 18 | return { |
| 19 | top: rect.top - viewport.top, |
| 20 | bottom: rect.bottom - viewport.top, |
| 21 | center: (rect.top + rect.bottom) / 2 - viewport.top |
| 22 | }; |
| 23 | }, index); |
| 24 | } |
| 25 | |
| 26 | for (const scale of [0.5, 1, 2]) { |
| 27 | test(`settles promptly under ancestor scale ${scale}`, async ({ page }) => { |
no outgoing calls
no test coverage detected