test(cypress): Replace SortableJS 1/4: characterize column header reorder ahead of SortableJS removal#1240
Merged
Merged
Conversation
… removal - overwrite the @4tw/cypress-drag-drop drag command with a native HTML5 DnD event sequence (pointerdown/mousedown -> dragstart -> dragenter/ dragover -> drop -> dragend) sharing one DataTransfer, so the same command drives SortableJS today and a native drag engine later - add characterization specs for plain header reorder (unorderable columns, onColumnsReordered payload, resizing unorderable columns), frozen-grid reorder (cross-boundary lock, scroll preservation, auto-scroll) and header-to-dropzone grouping drops - part 1 of the SortableJS removal (port of slickgrid-universal #2634) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Owner
|
@ghiscoding this is 1 of 4 of the Remove SortableJS module. It just adds tests. Check it out and merge if you're happy. |
Collaborator
|
@6pac it seems ok since it seems to copy my own tests implementation. However I'd like to finish the variable row height and release that. Also just to remind you that dropping SortableJS probably shouldn't be merged into master, but rather into a different branch for future major version. You can merge it seems ok, I'm going to bed soon |
Collaborator
|
ok just merging then, it seems ok |
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.
Context
First of a planned series of PRs to drop the SortableJS dependency, porting slickgrid-universal's refactor(core)!: drop SortableJS dependency (#2634) to this repo. Header column reordering — the main SortableJS-dependent feature — has very little dedicated e2e coverage today, so this first PR lands characterization tests that pin the observable behavior. They pass against the current SortableJS implementation and must keep passing unchanged when the native drag engine replaces it in the follow-up PR.
No
src/changes — this PR only touchescypress/.What's in here
cypress/support/drag.ts— overwrites thedragcommand from@4tw/cypress-drag-dropwith a native HTML5 DnD event sequence (pointerdown/mousedown→dragstart→dragenter/dragover→drop→dragend→pointerup/mouseup) sharing oneDataTransferand real coordinates. Ported from Slickgrid-Universal's version of the same helper, extended so a single command drives both SortableJS today and a native engine later:pointerdown/mousedown— SortableJS only arms itself from a press;dragstart— SortableJS activates the drag on_nextTick;dropSideoption lands drops decisively past the target midpoint (75%/25%) so the before/after insertion intent is unambiguous regardless of which engine interprets it.cypress/e2e/example14-column-reorder.cy.ts— plain reorder in both directions;onColumnsReorderedpayload shape (impactedColumns,previousColumnOrder); no event when the order is unchanged; unorderable columns (cannot be dragged, cannot be dropped onto, can still be resized); plus anit.skiphidden-column test documenting a latent bug — the SortableJStoArray()read-back silently loseshiddencolumns on any reorder — to be enabled when the native engine (which fixes it) lands.cypress/e2e/example-frozen-columns-reorder.cy.ts— reorder within the frozen (left) and non-frozen (right) sections; the frozen boundary is uncrossable in both directions; horizontal scroll position preserved after reorder; edge auto-scroll starts during a drag past the grid edge and stops on drop.cypress/e2e/example-draggable-grouping-header-drop.cy.ts— cross-list header→dropzone drag (the SortableJSgroup: { pull: 'clone' }semantics that the SlickDraggableGrouping port must reproduce later).Verification
.drag()(example-0032-row-span-many-columns,example-0070-plugin-state,example-grid-menu) pass unchanged through the overwritten command, as do both draggable-grouping pill-drag specs — i.e. the new command is proven against SortableJS on pre-existing expectations.Next up: the native column reorder engine in
slick.interactions.ts(branchrefactor/drop-sortablejs, stacked on this one).🤖 Generated with Claude Code