@@ -1386,7 +1386,7 @@ describe("ngAnimate $animateCss", function() {
1386
1386
they ( 'should not place a CSS transition block if options.skipBlocking is provided' ,
1387
1387
[ 'enter' , 'leave' , 'move' , 'addClass' , 'removeClass' ] , function ( event ) {
1388
1388
1389
- inject ( function ( $animateCss , $rootElement , $document ) {
1389
+ inject ( function ( $animateCss , $rootElement , $document , $sniffer , $window ) {
1390
1390
var element = jqLite ( '<div></div>' ) ;
1391
1391
$rootElement . append ( element ) ;
1392
1392
jqLite ( $document [ 0 ] . body ) . append ( $rootElement ) ;
@@ -1404,14 +1404,23 @@ describe("ngAnimate $animateCss", function() {
1404
1404
data . event = event ;
1405
1405
}
1406
1406
1407
+ var blockSpy = spyOn ( $window , 'blockTransitions' ) . andCallThrough ( ) ;
1408
+
1407
1409
data . skipBlocking = true ;
1408
1410
var animator = $animateCss ( element , data ) ;
1409
1411
1412
+ expect ( blockSpy ) . not . toHaveBeenCalled ( ) ;
1413
+
1410
1414
expect ( element . attr ( 'style' ) ) . toBeFalsy ( ) ;
1411
1415
animator . start ( ) ;
1412
1416
triggerAnimationStartFrame ( ) ;
1413
1417
1414
1418
expect ( element . attr ( 'style' ) ) . toBeFalsy ( ) ;
1419
+
1420
+ // just to prove it works
1421
+ data . skipBlocking = false ;
1422
+ var animator = $animateCss ( element , { addClass : 'test' } ) ;
1423
+ expect ( blockSpy ) . toHaveBeenCalled ( ) ;
1415
1424
} ) ;
1416
1425
} ) ;
1417
1426
0 commit comments