@@ -1209,6 +1209,34 @@ describe("animations", function() {
1209
1209
} ) ;
1210
1210
} ) ;
1211
1211
1212
+ they ( 'should allow an animation to run on the $prop element' , [ '$rootElement' , 'body' ] , function ( name ) {
1213
+ var capturedAnimation ;
1214
+
1215
+ module ( function ( $provide ) {
1216
+ $provide . factory ( '$rootElement' , function ( $document ) {
1217
+ return jqLite ( $document [ 0 ] . querySelector ( 'html' ) ) ;
1218
+ } ) ;
1219
+ $provide . factory ( '$$animation' , function ( $$AnimateRunner ) {
1220
+ return function ( element , method , options ) {
1221
+ capturedAnimation = arguments ;
1222
+ return new $$AnimateRunner ( ) ;
1223
+ } ;
1224
+ } ) ;
1225
+ } ) ;
1226
+ inject ( function ( $animate , $rootScope , $document , $rootElement ) {
1227
+ $animate . enabled ( true ) ;
1228
+
1229
+ var body = jqLite ( $document [ 0 ] . body ) ;
1230
+ var targetElement = name === 'body' ? body : $rootElement ;
1231
+
1232
+ $animate . addClass ( targetElement , 'red' ) ;
1233
+ $rootScope . $digest ( ) ;
1234
+
1235
+ expect ( capturedAnimation [ 0 ] ) . toBe ( targetElement ) ;
1236
+ expect ( capturedAnimation [ 1 ] ) . toBe ( 'addClass' ) ;
1237
+ } ) ;
1238
+ } ) ;
1239
+
1212
1240
describe ( '[ng-animate-children]' , function ( ) {
1213
1241
var parent , element , child , capturedAnimation , captureLog ;
1214
1242
beforeEach ( module ( function ( $provide ) {
0 commit comments