UNPKG

react-dnd-test-backend

Version:

A mock backend for testing React DnD apps

47 lines (46 loc) 1.03 kB
function noop() { // noop } export class TestBackendImpl { profile() { return {}; } setup() { this.didCallSetup = true; } teardown() { this.didCallTeardown = true; } connectDragSource() { return noop; } connectDragPreview() { return noop; } connectDropTarget() { return noop; } simulateBeginDrag(sourceIds, options) { this.actions.beginDrag(sourceIds, options); } simulatePublishDragSource() { this.actions.publishDragSource(); } simulateHover(targetIds, options) { this.actions.hover(targetIds, options); } simulateDrop() { this.actions.drop(); } simulateEndDrag() { this.actions.endDrag(); } constructor(manager, context){ this.didCallSetup = false; this.didCallTeardown = false; this.manager = manager; this.context = context; this.actions = manager.getActions(); } } //# sourceMappingURL=TestBackend.js.map