@@ -1270,6 +1270,36 @@ describe("ngAnimate", function() {
1270
1270
expect ( child . hasClass ( 'ng-enter-active' ) ) . toBe ( false ) ;
1271
1271
} ) ) ;
1272
1272
1273
+ it ( "should not set the transition property flag if only CSS animations are used" ,
1274
+ inject ( function ( $compile , $rootScope , $animate , $sniffer ) {
1275
+
1276
+ if ( ! $sniffer . animations ) return ;
1277
+
1278
+ ss . addRule ( '.ani.ng-enter' , 'my_animation 2s linear;' +
1279
+ vendorPrefix + 'animation: my_animation 2s linear' ) ;
1280
+
1281
+ ss . addRule ( '.trans.ng-enter' , 'transition:1s linear all;' +
1282
+ vendorPrefix + 'transition:1s linear all' ) ;
1283
+
1284
+ var element = html ( $compile ( '<div>...</div>' ) ( $rootScope ) ) ;
1285
+ var child = $compile ( '<div class="ani">...</div>' ) ( $rootScope ) ;
1286
+ child . css ( 'transition-property' , 'background-color' ) ;
1287
+
1288
+ $animate . enter ( child , element ) ;
1289
+ $rootScope . $digest ( ) ;
1290
+
1291
+ browserTrigger ( child , 'transitionend' , { timeStamp : Date . now ( ) + 2000 } ) ;
1292
+
1293
+ expect ( child . css ( 'transition-property' ) ) . toBe ( 'background-color' ) ;
1294
+ child . remove ( ) ;
1295
+
1296
+ child . attr ( 'class' , 'trans' ) ;
1297
+ $animate . enter ( child , element ) ;
1298
+ $rootScope . $digest ( ) ;
1299
+
1300
+ expect ( child . css ( 'transition-property' ) ) . not . toBe ( 'background-color' ) ;
1301
+ } ) ) ;
1302
+
1273
1303
it ( "should skip animations if the browser does not support CSS3 transitions and CSS3 animations" ,
1274
1304
inject ( function ( $compile , $rootScope , $animate , $sniffer ) {
1275
1305
0 commit comments