@@ -80,8 +80,10 @@ describe('$$animation', function() {
8080 } ;
8181 } ) ;
8282
83- inject ( function ( $$animation , $rootScope ) {
83+ inject ( function ( $$animation , $rootScope , $rootElement ) {
8484 element = jqLite ( '<div></div>' ) ;
85+ $rootElement . append ( element ) ;
86+
8587 $$animation ( element , 'enter' ) ;
8688 $rootScope . $digest ( ) ;
8789
@@ -109,7 +111,8 @@ describe('$$animation', function() {
109111 } ) ) ;
110112
111113 it ( "should obtain the element, event, the provided options and the domOperation" ,
112- inject ( function ( $$animation , $rootScope ) {
114+ inject ( function ( $$animation , $rootScope , $rootElement ) {
115+ $rootElement . append ( element ) ;
113116
114117 var options = { } ;
115118 options . foo = 'bar' ;
@@ -132,9 +135,11 @@ describe('$$animation', function() {
132135 } ) ) ;
133136
134137 it ( "should obtain the classes string which is a combination of className, addClass and removeClass" ,
135- inject ( function ( $$animation , $rootScope ) {
138+ inject ( function ( $$animation , $rootScope , $rootElement ) {
136139
137140 element . addClass ( 'blue red' ) ;
141+ $rootElement . append ( element ) ;
142+
138143 $$animation ( element , 'enter' , {
139144 addClass : 'green' ,
140145 removeClass : 'orange' ,
@@ -165,8 +170,9 @@ describe('$$animation', function() {
165170 } ) ;
166171 } ) ;
167172
168- inject ( function ( $$animation , $rootScope ) {
173+ inject ( function ( $$animation , $rootScope , $rootElement ) {
169174 element = jqLite ( '<div></div>' ) ;
175+ $rootElement . append ( element ) ;
170176 $$animation ( element , 'enter' ) ;
171177 $rootScope . $digest ( ) ;
172178 expect ( log ) . toEqual ( [ 'second' , 'first' ] ) ;
@@ -237,8 +243,10 @@ describe('$$animation', function() {
237243 } ) ;
238244 } ) ;
239245
240- inject ( function ( $$animation , $rootScope ) {
246+ inject ( function ( $$animation , $rootScope , $rootElement ) {
241247 element = jqLite ( '<div></div>' ) ;
248+ $rootElement . append ( element ) ;
249+
242250 var runner = $$animation ( element , 'enter' ) ;
243251 $rootScope . $digest ( ) ;
244252
@@ -791,6 +799,8 @@ describe('$$animation', function() {
791799 it ( 'should temporarily assign the provided CSS class for the duration of the animation' ,
792800 inject ( function ( $rootScope , $$animation ) {
793801
802+ parent . append ( element ) ;
803+
794804 $$animation ( element , 'enter' , {
795805 tempClasses : 'temporary fudge'
796806 } ) ;
@@ -809,6 +819,8 @@ describe('$$animation', function() {
809819 it ( 'should add and remove the ng-animate CSS class when the animation is active' ,
810820 inject ( function ( $$animation , $rootScope ) {
811821
822+ parent . append ( element ) ;
823+
812824 $$animation ( element , 'enter' ) ;
813825 $rootScope . $digest ( ) ;
814826 expect ( element ) . toHaveClass ( 'ng-animate' ) ;
@@ -823,6 +835,8 @@ describe('$$animation', function() {
823835 it ( 'should apply the `ng-animate` and temporary CSS classes before the driver is invoked' , function ( ) {
824836 var capturedElementClasses ;
825837
838+ parent . append ( element ) ;
839+
826840 module ( function ( $provide ) {
827841 $provide . factory ( 'mockedTestDriver' , function ( ) {
828842 return function ( details ) {
@@ -832,6 +846,8 @@ describe('$$animation', function() {
832846 } ) ;
833847
834848 inject ( function ( $$animation , $rootScope ) {
849+ parent . append ( element ) ;
850+
835851 $$animation ( element , 'enter' , {
836852 tempClasses : 'temp-class-name'
837853 } ) ;
@@ -845,6 +861,8 @@ describe('$$animation', function() {
845861 it ( 'should perform the DOM operation at the end of the animation if the driver doesn\'t run it already' ,
846862 inject ( function ( $$animation , $rootScope ) {
847863
864+ parent . append ( element ) ;
865+
848866 var domOperationFired = false ;
849867 $$animation ( element , 'enter' , {
850868 domOperation : function ( ) {
0 commit comments