test(forge-panel): measure drag positions after the collapsed-lines strip left

The hover plus case measured where to drag in notes.txt while README.md
above it still drew the strip for the unchanged lines after its last
hunk. The strip leaves once the file's text was read for highlighting,
which moves the rows below it up by 26 pixels. When it left between the
press and the release, the drag crossed one more row and opened a
comment on L3-5 in place of L3-4. The case now waits for the strip to
leave before it measures.

The race is in the test on master too: with master's forge sources the
case failed 1 of 15 runs alone, and the strip left 60 to 357 ms before
the drag began.
This commit is contained in:
LegGasai committed 2026-11-19 15:26:38 +08:00
1 parent 9d11b1d89c
commit 4f611e1cfa
1 file changed
+3
+3
View File
@@ -1633,6 +1633,9 @@ it.skipIf(MODE === 'record')('opens a comment from the hover plus in one press w
return { start: { x, y: start.y + start.height / 2 }, end: { x, y: end.y + end.height / 2 } }
}
await number('R3').waitFor()
// The strip after README.md's last hunk leaves once the file's text was read for highlighting, which moves the rows
// of notes.txt below it up; the positions this test measures for a drag hold only after that.
await file.locator('[data-forge-diff-gap]').waitFor({ state: 'detached', timeout: 20_000 })
// The plus appears only on the hovered side of the hovered row, for the code as for the line number.
expect(await plus('R3').isVisible()).toBe(false)