Files
dockview/jest-setup.ts
mathuoandClaude Opus 4.7 81036c8d08 refactor(dnd): address review findings + add dndStrategy docs
- pointerDragController: call getData() before mutating state so a throw
  doesn't strand the controller mid-drag; document singleton scope.
- tabGroupChip dragend listener: switch to { once: true } so the
  intentionally-detached listener still auto-removes.
- jest-setup: global afterEach that cancels any leftover pointer drag,
  so newly-added tests can't inherit singleton state.
- docs: new strategy.mdx for dndStrategy + touch gesture model; note in
  external.mdx on narrowing nativeEvent: DragEvent | PointerEvent.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-13 20:15:39 +01:00

12 lines
552 B
TypeScript

import '@testing-library/jest-dom';
import { PointerDragController } from './packages/dockview-core/src/dnd/pointer/pointerDragController';
// `PointerDragController` is a module-level singleton — state leaks across
// test files unless explicitly reset. Tests that drive a pointer drag end
// to end already call `cancel()` in their own beforeEach, but a global
// afterEach makes the cleanup automatic so newly-added tests can't
// accidentally inherit a half-finished drag.
afterEach(() => {
PointerDragController.getInstance().cancel();
});