Skip to content

Test: Atomic page.dragAndDrop swallows onSort/onChange/onMove intermediate events #73

@jjeff

Description

@jjeff

Problem

Three tests in tests/e2e/advanced-events.spec.ts and one in tests/e2e/ghost-elements.spec.ts are test.skip because Playwright's HTML5 page.dragAndDrop is atomic — the synthetic drag fires too quickly to reliably capture intermediate `dragover` events, which is where `onSort`, `onChange`, `onMove`, and the `sortable-drag` class transitions occur.

Affected tests

  • `tests/e2e/advanced-events.spec.ts:65` — should fire onSort event when sorting changes
  • `tests/e2e/advanced-events.spec.ts:100` — should fire onChange event when order changes within same list
  • `tests/e2e/advanced-events.spec.ts:134` — should fire onMove event during drag operations
  • `tests/e2e/ghost-elements.spec.ts:30` — applies drag class during drag operation

Hypothesis

The pointer pipeline path (used by `on-move.spec.ts` and the fallback-mode suites) drives the events properly via `page.mouse` low-level steps. The atomic `page.dragAndDrop` skips the intermediate states.

Suggested approach

Rewrite the four tests to use the same low-level `page.mouse.move` + `page.mouse.down`/`up` pattern that `on-move.spec.ts` uses, instead of `page.dragAndDrop` or `dragAndDropWithAnimation`. The `onMove` callback is already exercised in `on-move.spec.ts` via the pointer pipeline so the library function is verified — this is purely a test-infra rewrite.

Refs #35 — discovered during E2E skip triage.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtestTest coverage / quality

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions