@@ -312,21 +312,6 @@ describe('Dropzone', () => {
312
312
expect ( open ) . toHaveBeenCalled ( )
313
313
} )
314
314
315
- it ( 'should not call `open` if disableClick prop is true' , ( ) => {
316
- const dropzone = mount (
317
- < Dropzone disableClick >
318
- { ( { getRootProps, getInputProps } ) => (
319
- < div { ...getRootProps ( ) } >
320
- < input { ...getInputProps ( ) } />
321
- </ div >
322
- ) }
323
- </ Dropzone >
324
- )
325
- const open = jest . spyOn ( dropzone . instance ( ) , 'open' )
326
- dropzone . simulate ( 'click' )
327
- expect ( open ) . not . toHaveBeenCalled ( )
328
- } )
329
-
330
315
it ( 'should call `onClick` callback if provided' , ( ) => {
331
316
const onClick = jest . fn ( )
332
317
const dropzone = mount (
@@ -344,23 +329,6 @@ describe('Dropzone', () => {
344
329
expect ( onClick ) . toHaveBeenCalled ( )
345
330
} )
346
331
347
- it ( 'should call `onClick` if provided even if `disableClick` is set' , ( ) => {
348
- const onClick = jest . fn ( )
349
- const dropzone = mount (
350
- < Dropzone onClick = { onClick } disableClick >
351
- { ( { getRootProps, getInputProps } ) => (
352
- < div { ...getRootProps ( ) } >
353
- < input { ...getInputProps ( ) } />
354
- </ div >
355
- ) }
356
- </ Dropzone >
357
- )
358
- const open = jest . spyOn ( dropzone . instance ( ) , 'open' )
359
- dropzone . simulate ( 'click' )
360
- expect ( open ) . toHaveBeenCalledTimes ( 0 )
361
- expect ( onClick ) . toHaveBeenCalled ( )
362
- } )
363
-
364
332
it ( 'should not call `open` if event was prevented in `onClick`' , ( ) => {
365
333
const onClick = jest . fn ( event => event . preventDefault ( ) )
366
334
const dropzone = mount (
@@ -452,24 +420,6 @@ describe('Dropzone', () => {
452
420
expect ( onClickInner ) . toHaveBeenCalled ( )
453
421
} )
454
422
455
- it ( 'should invoke onClick on the wrapper if disableClick is set' , ( ) => {
456
- const onClick = jest . fn ( )
457
- const component = mount (
458
- < div onClick = { onClick } >
459
- < Dropzone disableClick >
460
- { ( { getRootProps, getInputProps } ) => (
461
- < div { ...getRootProps ( ) } >
462
- < input { ...getInputProps ( ) } />
463
- </ div >
464
- ) }
465
- </ Dropzone >
466
- </ div >
467
- )
468
-
469
- component . find ( Dropzone ) . simulate ( 'click' )
470
- expect ( onClick ) . toHaveBeenCalled ( )
471
- } )
472
-
473
423
it ( 'should invoke inputProps onClick if provided' , ( ) => {
474
424
const onClick = jest . fn ( )
475
425
const component = mount (
@@ -1078,7 +1028,7 @@ describe('Dropzone', () => {
1078
1028
describe ( 'open() fn' , ( ) => {
1079
1029
it ( 'should be exposed to children' , ( ) => {
1080
1030
const subject = mount (
1081
- < Dropzone disableClick >
1031
+ < Dropzone >
1082
1032
{ ( { getRootProps, getInputProps, open } ) => (
1083
1033
< div { ...getRootProps ( ) } >
1084
1034
< input { ...getInputProps ( ) } />
0 commit comments