@@ -24,7 +24,7 @@ describe('Droppable/makeDroppable', () => {
2424 } ) ;
2525
2626 it ( 'should correctly wrap the base component and set props' , ( ) => {
27- const DroppableComponent = makeDroppable ( ) ( TestComponent ) ;
27+ const DroppableComponent = makeDroppable ( { } ) ( TestComponent ) ;
2828 const component = shallow ( < DroppableComponent /> ) ;
2929
3030 assert . equal ( component . find ( 'TestComponent' ) . length , 1 ) ;
@@ -34,15 +34,15 @@ describe('Droppable/makeDroppable', () => {
3434 } ) ;
3535
3636 it ( 'should correctly set the initial state' , ( ) => {
37- const DroppableComponent = makeDroppable ( ) ( TestComponent ) ;
37+ const DroppableComponent = makeDroppable ( { } ) ( TestComponent ) ;
3838 const component = shallow ( < DroppableComponent /> ) ;
3939
4040 assert . equal ( component . state ( 'canDrop' ) , false ) ;
4141 assert . equal ( component . state ( 'isOver' ) , false ) ;
4242 } ) ;
4343
4444 it ( 'should set isOver to true and default canDrop to true on handleDragEnter' , ( ) => {
45- const DroppableComponent = makeDroppable ( ) ( TestComponent ) ;
45+ const DroppableComponent = makeDroppable ( { } ) ( TestComponent ) ;
4646 const component = shallow ( < DroppableComponent /> ) ;
4747 const instance = component . instance ( ) ;
4848
@@ -72,22 +72,19 @@ describe('Droppable/makeDroppable', () => {
7272 assert . equal ( component . state ( 'canDrop' ) , false ) ;
7373 } ) ;
7474
75- it ( 'should pass props, dataTransfer, and dragItem into dropValidator' , ( ) => {
76- const dragData = { hello : 'wasdfas' } ;
75+ it ( 'should pass props, dataTransfer into dropValidator' , ( ) => {
7776 const props = {
7877 className : 'abc'
7978 } ;
8079 const dataTransfer = { } ;
8180
8281 const dropDefinition = {
83- dropValidator : sandbox . mock ( ) . withArgs ( props , dataTransfer , dragData ) . once ( ) . returns ( true )
82+ dropValidator : sandbox . mock ( ) . withArgs ( props , dataTransfer ) . once ( ) . returns ( true )
8483 } ;
8584 const DroppableComponent = makeDroppable ( dropDefinition ) ( TestComponent ) ;
8685 const component = shallow ( < DroppableComponent { ...props } /> ) ;
8786 const instance = component . instance ( ) ;
8887
89- sandbox . mock ( instance ) . expects ( 'getDragItem' ) . returns ( dragData ) . once ( ) ;
90-
9188 assert . equal ( component . state ( 'isOver' ) , false ) ;
9289 instance . handleDragEnter ( {
9390 dataTransfer,
@@ -97,22 +94,8 @@ describe('Droppable/makeDroppable', () => {
9794 assert . equal ( component . state ( 'canDrop' ) , true ) ;
9895 } ) ;
9996
100- it ( 'should call onDragEnter during handleDragEnter if passed in through props' , ( ) => {
101- const dropDefinition = {
102- onDragEnter : sandbox . mock ( ) . once ( )
103- } ;
104- const DroppableComponent = makeDroppable ( dropDefinition ) ( TestComponent ) ;
105- const component = shallow ( < DroppableComponent /> ) ;
106- const instance = component . instance ( ) ;
107-
108- instance . handleDragEnter ( {
109- dataTransfer : { } ,
110- preventDefault : sandbox . mock ( ) . once ( )
111- } ) ;
112- } ) ;
113-
11497 it ( 'should set dropEffect to none on handleDragOver if canDrop is false' , ( ) => {
115- const DroppableComponent = makeDroppable ( ) ( TestComponent ) ;
98+ const DroppableComponent = makeDroppable ( { } ) ( TestComponent ) ;
11699 const component = shallow ( < DroppableComponent /> ) ;
117100 const instance = component . instance ( ) ;
118101 const event = {
@@ -129,7 +112,7 @@ describe('Droppable/makeDroppable', () => {
129112 } ) ;
130113
131114 it ( 'should set dropEffect on handleDragOver if canDrop is true and dropEffect was defined' , ( ) => {
132- const DroppableComponent = makeDroppable ( ) ( TestComponent ) ;
115+ const DroppableComponent = makeDroppable ( { } ) ( TestComponent ) ;
133116 const component = shallow ( < DroppableComponent /> ) ;
134117 const instance = component . instance ( ) ;
135118 const event = {
@@ -148,7 +131,7 @@ describe('Droppable/makeDroppable', () => {
148131 } ) ;
149132
150133 it ( 'should prevent default event on handleDragOver' , ( ) => {
151- const DroppableComponent = makeDroppable ( ) ( TestComponent ) ;
134+ const DroppableComponent = makeDroppable ( { } ) ( TestComponent ) ;
152135 const component = shallow ( < DroppableComponent /> ) ;
153136 const instance = component . instance ( ) ;
154137
@@ -162,22 +145,8 @@ describe('Droppable/makeDroppable', () => {
162145 } ) ;
163146 } ) ;
164147
165- it ( 'should call onDragOver during handleDragOver if passed in through props' , ( ) => {
166- const dropDefinition = {
167- onDragOver : sandbox . mock ( ) . once ( )
168- } ;
169- const DroppableComponent = makeDroppable ( dropDefinition ) ( TestComponent ) ;
170- const component = shallow ( < DroppableComponent /> ) ;
171- const instance = component . instance ( ) ;
172-
173- instance . handleDragOver ( {
174- dataTransfer : { } ,
175- preventDefault : sandbox . mock ( ) . once ( )
176- } ) ;
177- } ) ;
178-
179148 it ( 'should prevent default event and reset state on handleDrop' , ( ) => {
180- const DroppableComponent = makeDroppable ( ) ( TestComponent ) ;
149+ const DroppableComponent = makeDroppable ( { } ) ( TestComponent ) ;
181150 const component = shallow ( < DroppableComponent /> ) ;
182151 const instance = component . instance ( ) ;
183152
@@ -191,7 +160,6 @@ describe('Droppable/makeDroppable', () => {
191160 } ) ;
192161
193162 it ( 'should call onDrop if canDrop is true and onDrop is passed in through props' , ( ) => {
194- const data = { hello : 'wasdfas' } ;
195163 const event = {
196164 preventDefault : sandbox . mock ( ) . once ( )
197165 } ;
@@ -206,8 +174,6 @@ describe('Droppable/makeDroppable', () => {
206174 canDrop : true
207175 } ) ;
208176
209- sandbox . mock ( context . dragDrop ) . expects ( 'getDragItem' ) . returns ( data ) . once ( ) ;
210-
211177 instance . handleDrop ( event ) ;
212178 clock . tick ( 10 ) ;
213179 } ) ;
0 commit comments