@@ -350,6 +350,8 @@ describe('drag and drop', () => {
350350 beforeEach ( ( ) => {
351351 dragEndSpy = sinon . spy ( ) ;
352352 listenOnce ( grid , 'grid-dragend' , dragEndSpy ) ;
353+ grid . selectedItems = grid . items ;
354+ fireDragStart ( ) ;
353355 } ) ;
354356
355357 it ( 'should stop the native event' , ( ) => {
@@ -359,8 +361,16 @@ describe('drag and drop', () => {
359361 expect ( spy . called ) . to . be . false ;
360362 } ) ;
361363
364+ it ( 'should not stop the native event on grid itself' , ( ) => {
365+ fireDragEnd ( ) ;
366+
367+ const spy = sinon . spy ( ) ;
368+ listenOnce ( grid , 'dragend' , spy ) ;
369+ fireDragEnd ( grid ) ;
370+ expect ( spy . called ) . to . be . true ;
371+ } ) ;
372+
362373 it ( 'should remove dragging state attribute' , ( ) => {
363- fireDragStart ( ) ;
364374 fireDragEnd ( ) ;
365375 expect ( grid . hasAttribute ( 'dragging-rows' ) ) . to . be . false ;
366376 } ) ;
@@ -511,13 +521,21 @@ describe('drag and drop', () => {
511521
512522 describe ( 'dragleave' , ( ) => {
513523 it ( 'should stop the native event' , ( ) => {
524+ grid . dropMode = 'on-grid' ;
514525 const spy = sinon . spy ( ) ;
515526 listenOnce ( grid , 'dragleave' , spy ) ;
516527 fireDragLeave ( ) ;
517528 expect ( spy . called ) . to . be . false ;
518529 } ) ;
519530
520- it ( 'should clear the grid drag styles' , ( ) => {
531+ it ( 'should not stop the native event if grid has no drop mode' , ( ) => {
532+ const spy = sinon . spy ( ) ;
533+ listenOnce ( grid , 'dragleave' , spy ) ;
534+ fireDragLeave ( ) ;
535+ expect ( spy . called ) . to . be . true ;
536+ } ) ;
537+
538+ it ( 'should clear the grid dragover attribute' , ( ) => {
521539 grid . dropMode = 'on-grid' ;
522540 fireDragOver ( ) ;
523541 expect ( grid . hasAttribute ( 'dragover' ) ) . to . be . true ;
0 commit comments