@@ -1227,6 +1227,34 @@ describe("animations", function() {
1227
1227
} ) ;
1228
1228
} ) ;
1229
1229
1230
+ they ( 'should allow an animation to run on the $prop element' , [ '$rootElement' , 'body' ] , function ( name ) {
1231
+ var capturedAnimation ;
1232
+
1233
+ module ( function ( $provide ) {
1234
+ $provide . factory ( '$rootElement' , function ( $document ) {
1235
+ return jqLite ( $document [ 0 ] . querySelector ( 'html' ) ) ;
1236
+ } ) ;
1237
+ $provide . factory ( '$$animation' , function ( $$AnimateRunner ) {
1238
+ return function ( element , method , options ) {
1239
+ capturedAnimation = arguments ;
1240
+ return new $$AnimateRunner ( ) ;
1241
+ } ;
1242
+ } ) ;
1243
+ } ) ;
1244
+ inject ( function ( $animate , $rootScope , $document , $rootElement ) {
1245
+ $animate . enabled ( true ) ;
1246
+
1247
+ var body = jqLite ( $document [ 0 ] . body ) ;
1248
+ var targetElement = name === 'body' ? body : $rootElement ;
1249
+
1250
+ $animate . addClass ( targetElement , 'red' ) ;
1251
+ $rootScope . $digest ( ) ;
1252
+
1253
+ expect ( capturedAnimation [ 0 ] ) . toBe ( targetElement ) ;
1254
+ expect ( capturedAnimation [ 1 ] ) . toBe ( 'addClass' ) ;
1255
+ } ) ;
1256
+ } ) ;
1257
+
1230
1258
describe ( '[ng-animate-children]' , function ( ) {
1231
1259
var parent , element , child , capturedAnimation , captureLog ;
1232
1260
beforeEach ( module ( function ( $provide ) {
0 commit comments