@@ -1423,7 +1423,7 @@ describe("ngAnimate $animateCss", function() {
14231423 they ( 'should not place a CSS transition block if options.skipBlocking is provided' ,
14241424 [ 'enter' , 'leave' , 'move' , 'addClass' , 'removeClass' ] , function ( event ) {
14251425
1426- inject ( function ( $animateCss , $rootElement , $$body ) {
1426+ inject ( function ( $animateCss , $rootElement , $$body , $window ) {
14271427 var element = jqLite ( '<div></div>' ) ;
14281428 $rootElement . append ( element ) ;
14291429 $$body . append ( $rootElement ) ;
@@ -1441,14 +1441,23 @@ describe("ngAnimate $animateCss", function() {
14411441 data . event = event ;
14421442 }
14431443
1444+ var blockSpy = spyOn ( $window , 'blockTransitions' ) . andCallThrough ( ) ;
1445+
14441446 data . skipBlocking = true ;
14451447 var animator = $animateCss ( element , data ) ;
14461448
1449+ expect ( blockSpy ) . not . toHaveBeenCalled ( ) ;
1450+
14471451 expect ( element . attr ( 'style' ) ) . toBeFalsy ( ) ;
14481452 animator . start ( ) ;
14491453 triggerAnimationStartFrame ( ) ;
14501454
14511455 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 ( ) ;
14521461 } ) ;
14531462 } ) ;
14541463
0 commit comments