fix(e2e): make T541 row-position drop test independent of task sort order - #254
Merged
Merged
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The failing T541 assertion
secondHighIndex < sourceIndex < firstHighIndexrequired 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
firstHighRowatyRatio: 0.2therefore 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.loginbuildCrossSectionOrderUpdatesand 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 fromfirstHighRowtosecondHighRowand invert assertions tofirstHigh < 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