Skip to content

fix(e2e): make T541 row-position drop test independent of task sort order - #254

Merged
h4yfans merged 1 commit into
mainfrom
fix/e2e-tasks-t541-cross-section-drop
Apr 17, 2026
Merged

fix(e2e): make T541 row-position drop test independent of task sort order#254
h4yfans merged 1 commit into
mainfrom
fix/e2e-tasks-t541-cross-section-drop

Conversation

@h4yfans

@h4yfans h4yfans commented Apr 17, 2026

Copy link
Copy Markdown
Collaborator

Summary

The failing T541 assertion secondHighIndex < sourceIndex < firstHighIndex required the High section to render in [secondHigh, firstHigh] order (newest-created on top), but the actual product order is [firstHigh, secondHigh] (creation order, oldest first).

Hovering over firstHighRow at yRatio: 0.2 therefore landed source at section index 0 — visually identical to a section-header drop. That defeated the entire purpose of the test, which is to verify that hovering on a specific row inserts at that row's position, not at the section start.

Root cause verification

Added a temporary console.log in buildCrossSectionOrderUpdates and observed:

{ "targetOrder": ["firstHigh", "secondHigh"], "overId": "firstHigh", "overTaskEdge": "before", "sectionDropPosition": null, "insertIndex": 0 }

The drag handler is correct. The bug was entirely in the test's coupled assumption about pre-drop ordering.

Change

  • apps/desktop/tests/e2e/tasks.e2e.ts — switch hover target from firstHighRow to secondHighRow and invert assertions to firstHigh < source < secondHigh. Insertion now lands between the two existing rows, properly exercising row-position semantics regardless of sort order.

No production code changes.

Test plan

  • pnpm exec playwright test tasks.e2e.ts --grep "T541: should highlight the full target" — green in 11.3 s
  • All 6 T541 sibling tests still pass (49.6 s)
  • CI shard 3/3 confirms no regressions

…rder

The original assertion `secondHighIndex < sourceIndex < firstHighIndex`
required the High section to be ordered [secondHigh, firstHigh] (newest
first), but task lists actually render in creation order [firstHigh,
secondHigh]. Hovering over `firstHighRow.top` therefore landed source at
section index 0 — visually identical to a header drop — which is exactly
what the test was meant to distinguish from.

Switched the hover target to `secondHighRow.top` so insertion happens
between the two High rows, and inverted the assertions to match. This
properly exercises row-position semantics regardless of the underlying
sort order.

Verified by running diagnostic logging in `buildCrossSectionOrderUpdates`:
the function correctly resolves overId → insertIndex; the bug was purely
in the test's coupled assumption about pre-drop ordering.
@h4yfans
h4yfans merged commit ec59e61 into main Apr 17, 2026
2 checks passed
@h4yfans
h4yfans deleted the fix/e2e-tasks-t541-cross-section-drop branch April 17, 2026 10:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant