DO NOT MERGE: prove e2e tests fail without #2189 fix#2217
DO NOT MERGE: prove e2e tests fail without #2189 fix#2217alex-fedotyev wants to merge 2 commits into
Conversation
Adds Playwright regression coverage for the bug fixed in PR #2189: the dashed drag-select rectangle on the Event Deltas heatmap collapsed to a 2x2 px residue after mouseup unless u.select is mirrored from the URL state. Three scenarios in one spec: 1. Drag-select draws a persistent rectangle and writes URL state. Asserts URL gains xMin/xMax/yMin/yMax AND the .u-select element has width/height > 20 px, well above the 2x2 px collapse signature. 2. Reloading the page restores the rectangle from URL state. This is what specifically catches the ready-vs-onCreate timing issue: at onCreate u.scales.y.min/max aren't populated for mode-2 facet data, so the apply must run from uPlot's ready hook. The test reloads after a drag and asserts the rectangle returns with the same dimensions. 3. Clicking off the rectangle clears both URL state and the rectangle (collapses below 5 px on each axis). New SearchPage methods: openEventDeltasMode, getHeatmap, getHeatmapSelectionRect, dragHeatmapSelection. The drag helper spans both axes so the resulting selection has non-zero width AND height (uPlot treats single-axis drags as zero-size and skips the hook).
nuqs setFields and uPlot's ready hook both flush asynchronously after mouseup and after page reload. The synchronous reads at line 27 (URL params) and line 35/64 (post-reload boundingBox) raced with the flush and failed in CI shard 2 across all 3 retries: the URL never carried xMin= within the test window. Wrap each URL read in expect.poll(...) per param and gate the rect dimension reads on a polled width > 20 (or < 5 for the post-clear collapse). Capture rect once after polling settles, then assert the remaining dimensions and the cross-check round-trip. Also fixes lint: simple-import-sort/imports, prettier multi-line arg formatting on assertion messages.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
E2E Test Results❌ 3 tests failed • 164 passed • 3 skipped • 1208s
Tests ran across 4 shards in parallel. |
|
Served its purpose: confirmed all three test cases in the regression spec on PR #2209 fail when the selection-persistence fix from #2189 is absent. See run 25450398876 shard 3 — drag-select, reload-restore, and click-to-clear all fail at the rectangle-size polling assertions, with retries also failing. Closing without merge. |
Throwaway PR to verify the regression test in #2209 actually catches the HDX-4147 bug. Cherry-picks the e2e test commits onto plain main (which does NOT have #2189's selection-persistence fix). I'll watch the e2e shards fail, screenshot the failures, then close this PR.
If the e2e shards PASS here, the test is broken and I need to tighten it.