From 8db4a5e6b264b31d3d990eb9674d7e276ce24359 Mon Sep 17 00:00:00 2001 From: Alex Reardon Date: Tue, 19 Jun 2018 15:37:05 +1000 Subject: [PATCH] fixing middleware tests --- src/state/create-store.js | 5 +- src/state/middleware/auto-scroll.js | 19 +-- src/state/middleware/style.js | 8 +- .../drag-drop-context/drag-drop-context.jsx | 3 +- .../unit/state/middleware/auto-scroll.spec.js | 74 +++++++- test/unit/state/middleware/hooks.spec.js | 159 +++++------------- test/unit/state/middleware/lift.spec.js | 10 +- test/unit/state/middleware/style.spec.js | 102 ++++++++++- test/utils/dimension.js | 5 +- test/utils/preset-action-args.js | 56 +++--- 10 files changed, 267 insertions(+), 174 deletions(-) diff --git a/src/state/create-store.js b/src/state/create-store.js index aaa080a963..3ff41192b6 100644 --- a/src/state/create-store.js +++ b/src/state/create-store.js @@ -12,6 +12,7 @@ import autoScroll from './middleware/auto-scroll'; import pendingDrop from './middleware/pending-drop'; import type { DimensionMarshal } from './dimension-marshal/dimension-marshal-types'; import type { StyleMarshal } from '../view/style-marshal/style-marshal-types'; +import type { AutoScroller } from '../state/auto-scroller/auto-scroller-types'; import type { Store, Hooks, Announce } from '../types'; // We are checking if window is available before using it. @@ -26,6 +27,7 @@ type Args = {| styleMarshal: StyleMarshal, getHooks: () => Hooks, announce: Announce, + getScroller: () => AutoScroller, |} export default ({ @@ -33,6 +35,7 @@ export default ({ styleMarshal, getHooks, announce, + getScroller, }: Args): Store => createStore( reducer, composeEnhancers( @@ -70,7 +73,7 @@ export default ({ // When a drop animation finishes - fire a drop complete dropAnimationFinish, pendingDrop, - autoScroll(getDimensionMarshal), + autoScroll(getScroller), // Fire hooks for consumers hooks(getHooks, announce), ), diff --git a/src/state/middleware/auto-scroll.js b/src/state/middleware/auto-scroll.js index c6bfac84aa..8fbaa29e4b 100644 --- a/src/state/middleware/auto-scroll.js +++ b/src/state/middleware/auto-scroll.js @@ -16,19 +16,8 @@ import type { } from '../../types'; // TODO: this is broken - good times -export default (getMarshal: () => DimensionMarshal) => +export default (getScroller: () => AutoScroller) => (store: Store) => (next: (Action) => mixed) => { - const scroller: AutoScroller = createAutoScroller({ - ...bindActionCreators({ - // TODO: using next to avoid recursive calls to auto scrolling.. - move, - }, store.dispatch), - scrollDroppable: (id: DraggableId, change: Position): void => { - getMarshal().scrollDroppable(id, change); - }, - scrollWindow, - }); - const shouldCancel = (action: Action) => // Need to cancel any pending auto scrolling when drag is ending action.type === 'CANCEL' || @@ -40,7 +29,7 @@ export default (getMarshal: () => DimensionMarshal) => return (action: Action): mixed => { if (shouldCancel(action)) { - scroller.cancel(); + getScroller().cancel(); next(action); return; } @@ -57,7 +46,7 @@ export default (getMarshal: () => DimensionMarshal) => } if (state.autoScrollMode === 'FLUID') { - scroller.fluidScroll(state); + getScroller().fluidScroll(state); return; } @@ -65,6 +54,6 @@ export default (getMarshal: () => DimensionMarshal) => return; } - scroller.jumpScroll(state); + getScroller().jumpScroll(state); }; }; diff --git a/src/state/middleware/style.js b/src/state/middleware/style.js index fbef7ac55f..790118be13 100644 --- a/src/state/middleware/style.js +++ b/src/state/middleware/style.js @@ -4,14 +4,14 @@ import type { StyleMarshal } from '../../view/style-marshal/style-marshal-types' export default (marshal: StyleMarshal) => () => (next: (Action) => mixed) => (action: Action): mixed => { - if (action.type === 'COLLECTION_STARTING') { - marshal.collecting(); - } - if (action.type === 'INITIAL_PUBLISH' || action.type === 'PUBLISH') { marshal.dragging(); } + if (action.type === 'COLLECTION_STARTING') { + marshal.collecting(); + } + if (action.type === 'DROP_ANIMATE') { marshal.dropping(action.payload.result.reason); } diff --git a/src/view/drag-drop-context/drag-drop-context.jsx b/src/view/drag-drop-context/drag-drop-context.jsx index 85d4d0cad5..5238b00e29 100644 --- a/src/view/drag-drop-context/drag-drop-context.jsx +++ b/src/view/drag-drop-context/drag-drop-context.jsx @@ -90,6 +90,7 @@ export default class DragDropContext extends React.Component { onDragUpdate: this.props.onDragUpdate, }), announce: this.announcer.announce, + getScroller: () => this.autoScroller, }); const callbacks: DimensionMarshalCallbacks = bindActionCreators({ collectionStarting, @@ -104,7 +105,7 @@ export default class DragDropContext extends React.Component { scrollDroppable: this.dimensionMarshal.scrollDroppable, ...bindActionCreators({ move, - }), + }, this.store.dispatch), }); } // Need to declare childContextTypes without flow diff --git a/test/unit/state/middleware/auto-scroll.spec.js b/test/unit/state/middleware/auto-scroll.spec.js index 00233eb613..9d676bc782 100644 --- a/test/unit/state/middleware/auto-scroll.spec.js +++ b/test/unit/state/middleware/auto-scroll.spec.js @@ -1,2 +1,74 @@ + // @flow -throw new Error('TODO'); +import type { Action, Store } from '../../../../src/types'; +import type { AutoScroller } from '../../../../src/state/auto-scroller/auto-scroller-types'; +import createStore from './util/create-store'; +import middleware from '../../../../src/state/middleware/auto-scroll'; +import { animateDropArgs, userCancelArgs, completeDropArgs, initialPublishArgs } from '../../../utils/preset-action-args'; +import { animateDrop, drop, completeDrop, collectionStarting, prepare, initialPublish, moveDown, type InitialPublishArgs } from '../../../../src/state/action-creators'; + +const shouldCancel: Action[] = [ + animateDrop(animateDropArgs), + animateDrop(userCancelArgs), + drop({ reason: 'DROP' }), + drop({ reason: 'CANCEL' }), + completeDrop(completeDropArgs), + collectionStarting(), +]; + +const getScrollerStub = (): AutoScroller => ({ + cancel: jest.fn(), + fluidScroll: jest.fn(), + jumpScroll: jest.fn(), +}); + +shouldCancel.forEach((action: Action) => { + it(`should cancel a pending scroll when a ${action.type} is fired`, () => { + const scroller: AutoScroller = getScrollerStub(); + const store: Store = createStore(middleware(() => scroller)); + + store.dispatch(prepare()); + store.dispatch(initialPublish(initialPublishArgs)); + expect(store.getState().phase).toBe('DRAGGING'); + + expect(scroller.cancel).not.toHaveBeenCalled(); + store.dispatch(action); + expect(scroller.cancel).toHaveBeenCalled(); + }); +}); + +it('should fire a fluid scroll when in the FLUID auto scrolling mode', () => { + const scroller: AutoScroller = getScrollerStub(); + const store: Store = createStore(middleware(() => scroller)); + + store.dispatch(prepare()); + expect(scroller.fluidScroll).not.toHaveBeenCalled(); + + store.dispatch(initialPublish(initialPublishArgs)); + expect(scroller.fluidScroll).toHaveBeenCalledWith(store.getState()); + + store.dispatch(moveDown()); + expect(scroller.fluidScroll).toHaveBeenCalledWith(store.getState()); + expect(scroller.jumpScroll).not.toHaveBeenCalled(); +}); + +it('should fire a jump scroll when in the JUMP auto scrolling mode and there is a scroll jump request', () => { + const customInitial: InitialPublishArgs = { + ...initialPublishArgs, + autoScrollMode: 'JUMP', + }; + const scroller: AutoScroller = getScrollerStub(); + const store: Store = createStore(middleware(() => scroller)); + store.dispatch(prepare()); + + store.dispatch(initialPublish(customInitial)); + expect(scroller.jumpScroll).not.toHaveBeenCalled(); + expect(scroller.fluidScroll).not.toHaveBeenCalled(); + + store.dispatch(moveDown()); + expect(scroller.jumpScroll).not.toHaveBeenCalled(); + + // Currently no way to poke the state through an action to create a scrollJumpRequest + // TODO: investigate mechanism +}); + diff --git a/test/unit/state/middleware/hooks.spec.js b/test/unit/state/middleware/hooks.spec.js index 84967a5a5a..967770607d 100644 --- a/test/unit/state/middleware/hooks.spec.js +++ b/test/unit/state/middleware/hooks.spec.js @@ -12,26 +12,22 @@ import { moveUp, move, publish, - animateDrop, collectionStarting, type MoveArgs, type InitialPublishArgs, } from '../../../../src/state/action-creators'; import createStore from './util/create-store'; import { getPreset } from '../../../utils/dimension'; -import { viewport, initialPublishArgs, getDragStart, publishAdditionArgs } from '../../../utils/preset-action-args'; +import { initialPublishArgs, getDragStart, publishAdditionArgs } from '../../../utils/preset-action-args'; import type { DraggableLocation, Store, Hooks, State, Announce, - Critical, DragUpdate, DropResult, HookProvided, - DraggableDimension, - DimensionMap, Publish, DragStart, } from '../../../../src/types'; @@ -158,7 +154,44 @@ describe('update', () => { ); }); - describe('dynamic changes', () => { + it('should not call onDragUpdate if there is no movement from the last update', () => { + const hooks: Hooks = createHooks(); + const store: Store = createStore( + middleware(() => hooks, getAnnounce()) + ); + + store.dispatch(prepare()); + store.dispatch(initialPublish(initialPublishArgs)); + expect(hooks.onDragStart).toHaveBeenCalledTimes(1); + expect(hooks.onDragUpdate).not.toHaveBeenCalled(); + + // A movement to the same index is not causing an update + const moveArgs: MoveArgs = { + // tiny change + client: add(initialPublishArgs.client.selection, { x: 1, y: 1 }), + shouldAnimate: true, + }; + store.dispatch(move(moveArgs)); + + expect(hooks.onDragUpdate).not.toHaveBeenCalled(); + + // Triggering an actual movement + store.dispatch(moveDown()); + expect(hooks.onDragUpdate).toHaveBeenCalledTimes(1); + + const state: State = store.getState(); + invariant(state.phase === 'DRAGGING', 'Expecting state to be in dragging phase'); + + // A small movement that should not trigger any index changes + store.dispatch(move({ + client: add(state.current.client.selection, { x: -1, y: -1 }), + shouldAnimate: true, + })); + + expect(hooks.onDragUpdate).toHaveBeenCalledTimes(1); + }); + + describe('updates caused by dynamic changes', () => { it('should not call onDragUpdate if the destination or source have not changed', () => { const hooks: Hooks = createHooks(); const store: Store = createStore( @@ -216,6 +249,7 @@ describe('update', () => { // first move down store.dispatch(moveDown()); expect(hooks.onDragUpdate).toHaveBeenCalledTimes(1); + // $ExpectError - unknown mock reset property hooks.onDragUpdate.mockReset(); // move up into the original position @@ -237,6 +271,7 @@ describe('update', () => { }; expect(hooks.onDragUpdate).toHaveBeenCalledWith(lastUpdate, expect.any(Object)); expect(hooks.onDragUpdate).toHaveBeenCalledTimes(1); + // $ExpectError - unknown mock reset property hooks.onDragUpdate.mockReset(); // removing inHome1 @@ -269,112 +304,6 @@ describe('update', () => { expect(hooks.onDragUpdate).toHaveBeenCalledWith(postPublishUpdate, expect.any(Object)); }); }); - - it('should call onDragUpdate if the position has changed due to a bulk publish', () => { - const hooks: Hooks = createHooks(); - const store: Store = createStore( - middleware(() => hooks, getAnnounce()) - ); - - // initial publish and bulk publish - store.dispatch(prepare()); - store.dispatch(initialPublish(initialPublishArgs)); - expect(hooks.onDragStart).toHaveBeenCalledTimes(1); - store.dispatch(bulkReplace(initialBulkReplaceArgs)); - expect(hooks.onDragStart).toHaveBeenCalledTimes(1); - expect(hooks.onDragUpdate).not.toHaveBeenCalled(); - - // another bulk publish is in the works - store.dispatch(bulkCollectionStarting()); - - const { dimensions, critical } = initialPublishArgs; - const withNewIndex: DraggableDimension = { - ...dimensions.draggables[critical.draggable.id], - descriptor: { - ...critical.draggable, - index: critical.draggable.index + 100, - }, - }; - - const newCritical: Critical = { - draggable: withNewIndex.descriptor, - droppable: initialPublishArgs.critical.droppable, - }; - - const customDimensions: DimensionMap = { - droppables: dimensions.droppables, - // for simplicity just removing the other dimensions - draggables: { - [initialPublishArgs.critical.draggable.id]: withNewIndex, - }, - }; - - store.dispatch(bulkReplace({ - dimensions: customDimensions, - viewport, - critical: newCritical, - })); - - const update: DragUpdate = { - draggableId: critical.draggable.id, - type: critical.droppable.type, - source: { - droppableId: critical.droppable.id, - // now states that the new index is the starting index - index: withNewIndex.descriptor.index, - }, - // because we removed everything else, it will now be in the first position :D - destination: { - droppableId: initialPublishArgs.critical.droppable.id, - index: 0, - }, - }; - expect(hooks.onDragUpdate).toHaveBeenCalledWith( - update, - expect.any(Object), - ); - }); - - it('should not call onDragUpdate if there is no movement from the last update', () => { - const hooks: Hooks = createHooks(); - const store: Store = createStore( - middleware(() => hooks, getAnnounce()) - ); - - store.dispatch(prepare()); - store.dispatch(initialPublish(initialPublishArgs)); - expect(hooks.onDragStart).toHaveBeenCalledTimes(1); - expect(hooks.onDragUpdate).not.toHaveBeenCalled(); - - store.dispatch(bulkReplace(initialBulkReplaceArgs)); - // not called yet as position has not changed - expect(hooks.onDragUpdate).not.toHaveBeenCalled(); - - // A movement to the same index is not causing an update - const moveArgs: MoveArgs = { - // tiny change - client: add(initialPublishArgs.client.selection, { x: 1, y: 1 }), - shouldAnimate: true, - }; - store.dispatch(move(moveArgs)); - - expect(hooks.onDragUpdate).not.toHaveBeenCalled(); - - // Triggering an actual movement - store.dispatch(moveDown()); - expect(hooks.onDragUpdate).toHaveBeenCalledTimes(1); - - const state: State = store.getState(); - invariant(state.phase === 'DRAGGING', 'Expecting state to be in dragging phase'); - - // A small movement that should not trigger any index changes - store.dispatch(move({ - client: add(state.current.client.selection, { x: -1, y: -1 }), - shouldAnimate: true, - })); - - expect(hooks.onDragUpdate).toHaveBeenCalledTimes(1); - }); }); describe('abort', () => { @@ -431,7 +360,7 @@ describe('abort', () => { store.dispatch(initialPublish(initialPublishArgs)); const state: State = store.getState(); - invariant(state.phase === 'BULK_COLLECTING'); + invariant(state.phase === 'DRAGGING'); // in home location const home: DraggableLocation = { droppableId: initialPublishArgs.critical.droppable.id, @@ -472,6 +401,7 @@ describe('abort', () => { }; store.dispatch(completeDrop(result)); expect(hooks.onDragEnd).toHaveBeenCalledTimes(1); + // $ExpectError - unknown mock reset property hooks.onDragEnd.mockReset(); // abort @@ -504,7 +434,6 @@ describe('subsequent drags', () => { index: initialPublishArgs.critical.draggable.index + 1, }, }; - store.dispatch(bulkReplace(initialBulkReplaceArgs)); store.dispatch(moveDown()); expect(hooks.onDragUpdate).toHaveBeenCalledWith(update, expect.any(Object)); expect(hooks.onDragUpdate).toHaveBeenCalledTimes(1); @@ -559,7 +488,6 @@ describe('announcements', () => { execute: (store: Store) => { store.dispatch(prepare()); store.dispatch(initialPublish(initialPublishArgs)); - store.dispatch(bulkReplace(initialBulkReplaceArgs)); store.dispatch(moveDown()); }, defaultMessage: messagePreset.onDragUpdate(moveForwardUpdate), @@ -569,7 +497,6 @@ describe('announcements', () => { execute: (store: Store) => { store.dispatch(prepare()); store.dispatch(initialPublish(initialPublishArgs)); - store.dispatch(bulkReplace(initialBulkReplaceArgs)); store.dispatch(moveDown()); const result: DropResult = { diff --git a/test/unit/state/middleware/lift.spec.js b/test/unit/state/middleware/lift.spec.js index 9d0cbb9a11..340f9cbe1d 100644 --- a/test/unit/state/middleware/lift.spec.js +++ b/test/unit/state/middleware/lift.spec.js @@ -1,6 +1,6 @@ // @flow import type { Store, PendingDrop } from '../../../../src/types'; -import type { DimensionMarshal, Callbacks } from '../../../../src/state/dimension-marshal/dimension-marshal-types'; +import type { DimensionMarshal } from '../../../../src/state/dimension-marshal/dimension-marshal-types'; import middleware from '../../../../src/state/middleware/lift'; import createStore from './util/create-store'; import passThrough from './util/pass-through-middleware'; @@ -10,17 +10,13 @@ import { lift, initialPublish, clean, - publish, animateDrop, completeDrop, - collectionStarting, - updateDroppableScroll, - updateDroppableIsEnabled, } from '../../../../src/state/action-creators'; import getDimensionMarshal, { populateMarshal } from '../../../utils/dimension-marshal'; import getHomeLocation from '../../../../src/state/get-home-location'; import { - viewport, + preset, liftArgs, initialPublishArgs, getDragStart, @@ -35,7 +31,7 @@ const getMarshal = (store: Store): DimensionMarshal => { }; beforeEach(() => { - setViewport(viewport); + setViewport(preset.viewport); jest.useFakeTimers(); }); diff --git a/test/unit/state/middleware/style.spec.js b/test/unit/state/middleware/style.spec.js index 658f3f6835..1a0dd3f903 100644 --- a/test/unit/state/middleware/style.spec.js +++ b/test/unit/state/middleware/style.spec.js @@ -1,3 +1,103 @@ // @flow +import middleware from '../../../../src/state/middleware/style'; +import type { StyleMarshal } from '../../../../src/view/style-marshal/style-marshal-types'; +import type { Store } from '../../../../src/types'; +import createStore from './util/create-store'; +import { + initialPublish, + prepare, + collectionStarting, + publish, + animateDrop, + completeDrop, + clean, +} from '../../../../src/state/action-creators'; +import { + initialPublishArgs, + publishAdditionArgs, + animateDropArgs, + completeDropArgs, +} from '../../../utils/preset-action-args'; -throw new Error('TODO'); +const getMarshalStub = (): StyleMarshal => ({ + dragging: jest.fn(), + collecting: jest.fn(), + dropping: jest.fn(), + resting: jest.fn(), + mount: jest.fn(), + unmount: jest.fn(), + styleContext: 'why hello there', +}); + +it('should use the dragging styles on an initial publish', () => { + const marshal: StyleMarshal = getMarshalStub(); + const store: Store = createStore(middleware(marshal)); + + store.dispatch(prepare()); + store.dispatch(initialPublish(initialPublishArgs)); + + expect(marshal.dragging).toHaveBeenCalled(); +}); + +it('should use the dragging styles when a dynamic collection is starting', () => { + const marshal: StyleMarshal = getMarshalStub(); + const store: Store = createStore(middleware(marshal)); + + store.dispatch(prepare()); + store.dispatch(initialPublish(initialPublishArgs)); + store.dispatch(collectionStarting()); + + expect(marshal.collecting).toHaveBeenCalled(); +}); + +it('should use the dragging styles after a dynamic publish', () => { + const marshal: StyleMarshal = getMarshalStub(); + const store: Store = createStore(middleware(marshal)); + + store.dispatch(prepare()); + store.dispatch(initialPublish(initialPublishArgs)); + marshal.dragging.mockReset(); + + store.dispatch(collectionStarting()); + expect(marshal.dragging).not.toHaveBeenCalled(); + + store.dispatch(publish(publishAdditionArgs)); + expect(marshal.dragging).toHaveBeenCalled(); +}); + +it('should use the dropping styles when drop animating', () => { + const marshal: StyleMarshal = getMarshalStub(); + const store: Store = createStore(middleware(marshal)); + + store.dispatch(prepare()); + store.dispatch(initialPublish(initialPublishArgs)); + store.dispatch(animateDrop(animateDropArgs)); + + expect(marshal.dropping).toHaveBeenCalledWith(animateDropArgs.result.reason); +}); + +it('should use the resting styles when a drop completes', () => { + const marshal: StyleMarshal = getMarshalStub(); + const store: Store = createStore(middleware(marshal)); + + store.dispatch(prepare()); + store.dispatch(initialPublish(initialPublishArgs)); + + expect(marshal.resting).not.toHaveBeenCalled(); + store.dispatch(completeDrop(completeDropArgs)); + + expect(marshal.resting).toHaveBeenCalled(); +}); + +it('should use the resting styles when aborting', () => { + const marshal: StyleMarshal = getMarshalStub(); + const store: Store = createStore(middleware(marshal)); + + store.dispatch(prepare()); + store.dispatch(initialPublish(initialPublishArgs)); + + expect(marshal.resting).not.toHaveBeenCalled(); + store.dispatch(clean()); + + expect(marshal.resting).toHaveBeenCalled(); +}); diff --git a/test/utils/dimension.js b/test/utils/dimension.js index c194f38ded..56e0d2323e 100644 --- a/test/utils/dimension.js +++ b/test/utils/dimension.js @@ -513,8 +513,11 @@ export const getPreset = (axis?: Axis = vertical) => { }; const viewport: Viewport = (() => { - const base: Viewport = getViewport(); + // scroll the viewport so it has the right frame + const base: Viewport = scrollViewport(getViewport(), windowScroll); + // set the initial and current scroll so that it is the same + // we are faking a lift from a scrolled window const result: Viewport = { frame: base.frame, scroll: { diff --git a/test/utils/preset-action-args.js b/test/utils/preset-action-args.js index 7aba405e75..7cfc1fccb8 100644 --- a/test/utils/preset-action-args.js +++ b/test/utils/preset-action-args.js @@ -1,17 +1,17 @@ // @flow -import { getRect, type Rect, type Position } from 'css-box-model'; import { getPreset, getDraggableDimension } from './dimension'; -import getViewport from '../../src/view/window/get-viewport'; import { offsetByPosition } from '../../src/state/spacing'; import getHomeLocation from '../../src/state/get-home-location'; +import getHomeImpact from '../../src/state/get-home-impact'; import type { Critical, + DropResult, DragStart, ItemPositions, - Viewport, DimensionMap, Publish, DraggableDimension, + PendingDrop, } from '../../src/types'; import type{ InitialPublishArgs, @@ -21,25 +21,6 @@ import type{ // In case a consumer needs the references export const preset = getPreset(); -// const origin: Position = { x: 0, y: 0 }; -// export const viewport: Viewport = (() => { -// const initial: Viewport = getViewport(); -// const shifted: Rect = getRect(offsetByPosition(initial.frame, preset.windowScroll)); - -// return { -// frame: shifted, -// scroll: { -// initial: preset.windowScroll, -// current: preset.windowScroll, -// max: initial.scroll.max, -// diff: { -// value: origin, -// displacement: origin, -// }, -// }, -// }; -// })(); - export const critical: Critical = { draggable: preset.inHome1.descriptor, droppable: preset.home.descriptor, @@ -92,6 +73,32 @@ export const publishAdditionArgs: Publish = (() => { }; })(); +export const getDragStart = (custom?: Critical = critical): DragStart => ({ + draggableId: custom.draggable.id, + type: custom.droppable.type, + source: getHomeLocation(custom), +}); + +export const completeDropArgs: DropResult = { + ...getDragStart(critical), + destination: getHomeLocation(critical), + reason: 'DROP', +}; + +export const animateDropArgs: PendingDrop = { + newHomeOffset: { x: 10, y: 10 }, + impact: getHomeImpact(critical, preset.dimensions), + result: completeDropArgs, +}; + +export const userCancelArgs: PendingDrop = { + ...animateDropArgs, + result: { + ...completeDropArgs, + reason: 'CANCEL', + }, +}; + export const copy = (dimensions: DimensionMap): DimensionMap => ({ droppables: { ...dimensions.droppables, @@ -101,8 +108,3 @@ export const copy = (dimensions: DimensionMap): DimensionMap => ({ }, }); -export const getDragStart = (custom?: Critical = critical): DragStart => ({ - draggableId: custom.draggable.id, - type: custom.droppable.type, - source: getHomeLocation(custom), -});