@@ -579,6 +579,27 @@ describe('drag and drop', () => {
579579 fireDragOver ( row , 'under' ) ;
580580 expect ( row . getAttribute ( 'dragover' ) ) . to . equal ( 'below' ) ;
581581 } ) ;
582+
583+ it ( 'should clear previous dragover row part attribute on dragover change' , ( ) => {
584+ grid . dropMode = 'between' ;
585+ const row = grid . $ . items . children [ 0 ] ;
586+ fireDragOver ( row , 'above' ) ;
587+ fireDragOver ( row , 'below' ) ;
588+ expect ( row . getAttribute ( 'part' ) ) . to . not . contain ( 'dragover-above-row' ) ;
589+ expect ( row . getAttribute ( 'part' ) ) . to . contain ( 'dragover-below-row' ) ;
590+ } ) ;
591+
592+ it ( 'should clear previous dragover cells part attribute on dragover change' , ( ) => {
593+ grid . dropMode = 'between' ;
594+ const row = grid . $ . items . children [ 0 ] ;
595+ fireDragOver ( row , 'above' ) ;
596+ fireDragOver ( row , 'below' ) ;
597+ const cells = getRowBodyCells ( row ) ;
598+ cells . forEach ( ( cell ) => {
599+ expect ( cell . getAttribute ( 'part' ) ) . to . not . contain ( 'dragover-above-row-cell' ) ;
600+ expect ( cell . getAttribute ( 'part' ) ) . to . contain ( 'dragover-below-row-cell' ) ;
601+ } ) ;
602+ } ) ;
582603 } ) ;
583604
584605 describe ( 'dragleave' , ( ) => {
@@ -589,22 +610,45 @@ describe('drag and drop', () => {
589610 expect ( spy . called ) . to . be . false ;
590611 } ) ;
591612
592- it ( 'should clear the grid drag styles ' , ( ) => {
613+ it ( 'should clear the grid dragover attribute ' , ( ) => {
593614 grid . dropMode = 'on-grid' ;
594615 fireDragOver ( ) ;
595616 expect ( grid . hasAttribute ( 'dragover' ) ) . to . be . true ;
596617 fireDragLeave ( ) ;
597618 expect ( grid . hasAttribute ( 'dragover' ) ) . to . be . false ;
598619 } ) ;
599620
600- it ( 'should clear the row drag styles ' , ( ) => {
621+ it ( 'should clear the row dragover attribute ' , ( ) => {
601622 grid . dropMode = 'on-top' ;
602623 fireDragOver ( ) ;
603624 const row = grid . $ . items . children [ 0 ] ;
604625 expect ( row . hasAttribute ( 'dragover' ) ) . to . be . true ;
605626 fireDragLeave ( ) ;
606627 expect ( row . hasAttribute ( 'dragover' ) ) . to . be . false ;
607628 } ) ;
629+
630+ it ( 'should clear the row dragover parts' , ( ) => {
631+ grid . dropMode = 'on-top' ;
632+ fireDragOver ( ) ;
633+ const row = grid . $ . items . children [ 0 ] ;
634+ expect ( row . getAttribute ( 'part' ) ) . to . contain ( 'dragover-' ) ;
635+ fireDragLeave ( ) ;
636+ expect ( row . getAttribute ( 'part' ) ) . to . not . contain ( 'dragover-' ) ;
637+ } ) ;
638+
639+ it ( 'should clear the cells dragover parts' , ( ) => {
640+ grid . dropMode = 'on-top' ;
641+ fireDragOver ( ) ;
642+ const row = grid . $ . items . children [ 0 ] ;
643+ const cells = getRowBodyCells ( row ) ;
644+ cells . forEach ( ( cell ) => {
645+ expect ( cell . getAttribute ( 'part' ) ) . to . contain ( 'dragover-' ) ;
646+ } ) ;
647+ fireDragLeave ( ) ;
648+ cells . forEach ( ( cell ) => {
649+ expect ( cell . getAttribute ( 'part' ) ) . to . not . contain ( 'dragover-' ) ;
650+ } ) ;
651+ } ) ;
608652 } ) ;
609653
610654 describe ( 'dragenter' , ( ) => {
@@ -665,6 +709,29 @@ describe('drag and drop', () => {
665709 expect ( row . hasAttribute ( 'dragover' ) ) . to . be . false ;
666710 } ) ;
667711
712+ it ( 'should clear the row dragover parts' , ( ) => {
713+ grid . dropMode = 'on-top' ;
714+ fireDragOver ( ) ;
715+ const row = grid . $ . items . children [ 0 ] ;
716+ expect ( row . getAttribute ( 'part' ) ) . to . contain ( 'dragover-' ) ;
717+ fireDrop ( ) ;
718+ expect ( row . getAttribute ( 'part' ) ) . to . not . contain ( 'dragover-' ) ;
719+ } ) ;
720+
721+ it ( 'should clear the cells dragover parts' , ( ) => {
722+ grid . dropMode = 'on-top' ;
723+ fireDragOver ( ) ;
724+ const row = grid . $ . items . children [ 0 ] ;
725+ const cells = getRowBodyCells ( row ) ;
726+ cells . forEach ( ( cell ) => {
727+ expect ( cell . getAttribute ( 'part' ) ) . to . contain ( 'dragover-' ) ;
728+ } ) ;
729+ fireDrop ( ) ;
730+ cells . forEach ( ( cell ) => {
731+ expect ( cell . getAttribute ( 'part' ) ) . to . not . contain ( 'dragover-' ) ;
732+ } ) ;
733+ } ) ;
734+
668735 it ( 'should dispatch a grid specific event' , ( ) => {
669736 fireDrop ( ) ;
670737 expect ( dropSpy . calledOnce ) . to . be . true ;
0 commit comments