@@ -15,21 +15,23 @@ describe('draggable directive', () => {
15
15
[dragSnapGrid]="dragSnapGrid"
16
16
[ghostDragEnabled]="ghostDragEnabled"
17
17
[validateDrag]="validateDrag"
18
+ [dragCursor]="dragCursor"
18
19
(dragStart)="dragStart($event)"
19
20
(dragging)="dragging($event)"
20
21
(dragEnd)="dragEnd($event)">
21
22
Drag me!
22
23
</div>`
23
24
} )
24
25
class TestComponent {
25
- @ViewChild ( DraggableDirective ) public draggable : DraggableDirective ;
26
- public dragStart : sinon . SinonSpy = sinon . spy ( ) ;
27
- public dragging : sinon . SinonSpy = sinon . spy ( ) ;
28
- public dragEnd : sinon . SinonSpy = sinon . spy ( ) ;
29
- public dragAxis : any = { x : true , y : true } ;
30
- public dragSnapGrid : any = { } ;
31
- public ghostDragEnabled : boolean = true ;
32
- public validateDrag : ValidateDrag ;
26
+ @ViewChild ( DraggableDirective ) draggable : DraggableDirective ;
27
+ dragStart : sinon . SinonSpy = sinon . spy ( ) ;
28
+ dragging : sinon . SinonSpy = sinon . spy ( ) ;
29
+ dragEnd : sinon . SinonSpy = sinon . spy ( ) ;
30
+ dragAxis : any = { x : true , y : true } ;
31
+ dragSnapGrid : any = { } ;
32
+ ghostDragEnabled : boolean = true ;
33
+ validateDrag : ValidateDrag ;
34
+ dragCursor = 'move' ;
33
35
}
34
36
35
37
beforeEach ( ( ) => {
@@ -533,4 +535,15 @@ describe('draggable directive', () => {
533
535
} ) ;
534
536
expect ( draggableElement . style . transform ) . not . to . be . ok ;
535
537
} ) ;
538
+
539
+ it ( 'should disable the mouse move cursor' , ( ) => {
540
+ fixture . componentInstance . dragCursor = '' ;
541
+ fixture . detectChanges ( ) ;
542
+ const draggableElement : HTMLElement =
543
+ fixture . componentInstance . draggable . element . nativeElement ;
544
+ triggerDomEvent ( 'mouseenter' , draggableElement ) ;
545
+ expect ( draggableElement . style . cursor ) . not . to . be . ok ;
546
+ triggerDomEvent ( 'mouseleave' , draggableElement ) ;
547
+ expect ( draggableElement . style . cursor ) . not . to . be . ok ;
548
+ } ) ;
536
549
} ) ;
0 commit comments