Skip to content

test(cypress): Replace SortableJS 1/4: characterize column header reorder ahead of SortableJS removal#1240

Merged
ghiscoding merged 1 commit into
masterfrom
test/column-reorder-e2e
Jul 17, 2026
Merged

test(cypress): Replace SortableJS 1/4: characterize column header reorder ahead of SortableJS removal#1240
ghiscoding merged 1 commit into
masterfrom
test/column-reorder-e2e

Conversation

@6pac-ai

@6pac-ai 6pac-ai commented Jul 17, 2026

Copy link
Copy Markdown
Collaborator

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 touches cypress/.

What's in here

  • cypress/support/drag.ts — overwrites the drag command from @4tw/cypress-drag-drop with a native HTML5 DnD event sequence (pointerdown/mousedowndragstartdragenter/dragoverdropdragendpointerup/mouseup) sharing one DataTransfer and 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:
    • prepends pointerdown/mousedown — SortableJS only arms itself from a press;
    • yields a macrotask after dragstart — SortableJS activates the drag on _nextTick;
    • dropSide option 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; onColumnsReordered payload shape (impactedColumns, previousColumnOrder); no event when the order is unchanged; unorderable columns (cannot be dragged, cannot be dropped onto, can still be resized); plus an it.skip hidden-column test documenting a latent bug — the SortableJS toArray() read-back silently loses hidden columns 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 SortableJS group: { pull: 'clone' } semantics that the SlickDraggableGrouping port must reproduce later).

Verification

  • Full 47-spec Cypress suite: 599/601 passing, 0 failures (2 intentional pendings).
  • The three existing specs that already dragged headers via .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 (branch refactor/drop-sortablejs, stacked on this one).

🤖 Generated with Claude Code

… 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>
@6pac

6pac commented Jul 17, 2026

Copy link
Copy Markdown
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.

@ghiscoding

Copy link
Copy Markdown
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

@6pac 6pac changed the title test(cypress): characterize column header reorder ahead of SortableJS removal test(cypress): Replace SortableJS 1/4: characterize column header reorder ahead of SortableJS removal Jul 17, 2026
@ghiscoding

Copy link
Copy Markdown
Collaborator

ok just merging then, it seems ok

@ghiscoding
ghiscoding merged commit 31754f4 into master Jul 17, 2026
4 of 5 checks passed
@ghiscoding
ghiscoding deleted the test/column-reorder-e2e branch July 17, 2026 14:03
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.

3 participants