test(selection): behavior tests for drag selection across marks and tables (SD-2057)#2318
test(selection): behavior tests for drag selection across marks and tables (SD-2057)#2318
Conversation
…nd tables (SD-2057) Add 6 Playwright behavior tests covering the selection fixes from PR #2205: - Selection overlay remains visible when selecting across mark boundaries (bold → italic, different formatting runs) - Drag selection maintains continuous overlay without flicker mid-drag - Drag from paragraph into table clamps at the table boundary - Wide selection spanning past a table is allowed with visible overlay All tests pass on Chromium, Firefox, and WebKit.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1fe21860ec
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| await superdoc.page.mouse.down(); | ||
|
|
||
| // Drag across the line in small increments, sampling overlay at each step | ||
| let minRects = Infinity; |
There was a problem hiding this comment.
Assert that mid-drag sampling actually observed a selection
minRects starts as Infinity and is only updated inside if (sel.to - sel.from > 0). If a regression causes the drag to never produce a non-collapsed selection during sampled steps, minRects remains Infinity and expect(minRects).toBeGreaterThan(0) still passes, turning this into a false positive test. Add an explicit assertion that at least one non-collapsed sample was recorded before checking the minimum rect count.
Useful? React with 👍 / 👎.
Summary
Adds 6 Playwright behavior tests covering the selection fixes from PR #2205 (SD-2024):
All tests pass on Chromium, Firefox, and WebKit.
Resolves SD-2057
Test plan
npx playwright test tests/selection/drag-selection-across-marks-and-tables.spec.ts— 6/6 pass on all 3 browsers