mirror of
https://github.com/stablyai/orca.git
synced 2026-09-22 00:02:31 +00:00
test(e2e): use bounding box for quick-open hover positioning
Handle cases where the quick-open result element remounts by tracking its current bounding box and using absolute mouse positioning instead of relative row.hover() calls.
This commit is contained in:
@@ -49,8 +49,14 @@ test('cmd+p quick open prioritizes the filename and reveals the full path on hov
|
||||
// tooltip left open from a prior attempt can swallow the next hover.
|
||||
await expect(async () => {
|
||||
await orcaPage.mouse.move(8, 8)
|
||||
await row.hover({ position: { x: 20, y: 12 }, timeout: 2_000 })
|
||||
await row.hover({ position: { x: 40, y: 12 }, timeout: 2_000 })
|
||||
const currentRow = dialog.getByRole('option').filter({ hasText: 'QuickOpenTarget.tsx' }).first()
|
||||
await expect(currentRow).toBeVisible()
|
||||
const currentBox = await currentRow.boundingBox()
|
||||
if (!currentBox) {
|
||||
throw new Error('Quick Open result remounted before hover')
|
||||
}
|
||||
await orcaPage.mouse.move(currentBox.x + 20, currentBox.y + 12)
|
||||
await orcaPage.mouse.move(currentBox.x + 40, currentBox.y + 12)
|
||||
await expect(tooltip).toBeVisible({ timeout: 2_000 })
|
||||
}).toPass({ timeout: 15_000, intervals: [100, 250, 500] })
|
||||
|
||||
|
||||
Reference in New Issue
Block a user