From 4f611e1cfa29d42e7fd0e1e419df46b8c027e5a6 Mon Sep 17 00:00:00 2001 From: LegGasai Date: Thu, 19 Nov 2026 15:26:38 +0800 Subject: [PATCH] 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. --- apps/web/tests/forge-panel.e2e.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/apps/web/tests/forge-panel.e2e.ts b/apps/web/tests/forge-panel.e2e.ts index 7a7e581c9d..8017a6e3ce 100644 --- a/apps/web/tests/forge-panel.e2e.ts +++ b/apps/web/tests/forge-panel.e2e.ts @@ -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)