@@ -1423,7 +1423,7 @@ describe("ngAnimate $animateCss", function() {
1423
1423
they ( 'should not place a CSS transition block if options.skipBlocking is provided' ,
1424
1424
[ 'enter' , 'leave' , 'move' , 'addClass' , 'removeClass' ] , function ( event ) {
1425
1425
1426
- inject ( function ( $animateCss , $rootElement , $$body ) {
1426
+ inject ( function ( $animateCss , $rootElement , $$body , $window ) {
1427
1427
var element = jqLite ( '<div></div>' ) ;
1428
1428
$rootElement . append ( element ) ;
1429
1429
$$body . append ( $rootElement ) ;
@@ -1441,14 +1441,23 @@ describe("ngAnimate $animateCss", function() {
1441
1441
data . event = event ;
1442
1442
}
1443
1443
1444
+ var blockSpy = spyOn ( $window , 'blockTransitions' ) . andCallThrough ( ) ;
1445
+
1444
1446
data . skipBlocking = true ;
1445
1447
var animator = $animateCss ( element , data ) ;
1446
1448
1449
+ expect ( blockSpy ) . not . toHaveBeenCalled ( ) ;
1450
+
1447
1451
expect ( element . attr ( 'style' ) ) . toBeFalsy ( ) ;
1448
1452
animator . start ( ) ;
1449
1453
triggerAnimationStartFrame ( ) ;
1450
1454
1451
1455
expect ( element . attr ( 'style' ) ) . toBeFalsy ( ) ;
1456
+
1457
+ // just to prove it works
1458
+ data . skipBlocking = false ;
1459
+ var animator = $animateCss ( element , { addClass : 'test' } ) ;
1460
+ expect ( blockSpy ) . toHaveBeenCalled ( ) ;
1452
1461
} ) ;
1453
1462
} ) ;
1454
1463
0 commit comments