@@ -15,6 +15,7 @@ describe('draggable directive', () => {
15
15
[dragAxis]="dragAxis"
16
16
[dragSnapGrid]="dragSnapGrid"
17
17
[ghostDragEnabled]="ghostDragEnabled"
18
+ [showOriginalElementWhileDragging]="showOriginalElementWhileDragging"
18
19
[validateDrag]="validateDrag"
19
20
[dragCursor]="dragCursor"
20
21
[dragActiveClass]="dragActiveClass"
@@ -36,6 +37,7 @@ describe('draggable directive', () => {
36
37
dragAxis : any = { x : true , y : true } ;
37
38
dragSnapGrid : any = { } ;
38
39
ghostDragEnabled : boolean = true ;
40
+ showOriginalElementWhileDragging : boolean = false ;
39
41
validateDrag : ValidateDrag ;
40
42
dragCursor = 'move' ;
41
43
dragActiveClass : string ;
@@ -587,6 +589,17 @@ describe('draggable directive', () => {
587
589
expect ( draggableElement . style . visibility ) . not . to . be . ok ;
588
590
} ) ;
589
591
592
+ it ( 'should create a clone of the element and leave old element visible' , ( ) => {
593
+ fixture . componentInstance . showOriginalElementWhileDragging = true ;
594
+ fixture . detectChanges ( ) ;
595
+ const draggableElement =
596
+ fixture . componentInstance . draggableElement . nativeElement ;
597
+ triggerDomEvent ( 'mousedown' , draggableElement , { clientX : 5 , clientY : 10 } ) ;
598
+ triggerDomEvent ( 'mousemove' , draggableElement , { clientX : 7 , clientY : 10 } ) ;
599
+ expect ( draggableElement . style . visibility ) . not . to . be . ok ;
600
+ triggerDomEvent ( 'mouseup' , draggableElement , { clientX : 7 , clientY : 8 } ) ;
601
+ } ) ;
602
+
590
603
it ( 'should add and remove the drag active class' , ( ) => {
591
604
fixture . componentInstance . dragActiveClass = 'drag-active' ;
592
605
fixture . detectChanges ( ) ;
0 commit comments