2
2
3
3
describe ( "ngAnimate $animateCss" , function ( ) {
4
4
5
+ // Firefox transforms all transition timing function values to their cubic bezier equivalents
6
+ var CUBIC_BEZIER_LINEAR_EQUIVALENT = 'cubic-bezier(0, 0, 1, 1)' ;
7
+ var CUBIC_BEZIER_EASE_EQUIVALENT = 'cubic-bezier(0.25, 0.1, 0.25, 1)' ;
8
+
5
9
beforeEach ( module ( 'ngAnimate' ) ) ;
6
10
beforeEach ( module ( 'ngAnimateMock' ) ) ;
7
11
@@ -710,7 +714,7 @@ describe("ngAnimate $animateCss", function() {
710
714
triggerAnimationStartFrame ( ) ;
711
715
712
716
// IE reports ease in cubic-bezier form
713
- expect ( element . css ( 'transition-timing-function' ) ) . toBeOneOf ( 'ease' , 'cubic-bezier(0.25, 0.1, 0.25, 1)' ) ;
717
+ expect ( element . css ( 'transition-timing-function' ) ) . toBeOneOf ( 'ease' , CUBIC_BEZIER_EASE_EQUIVALENT ) ;
714
718
} ) ) ;
715
719
716
720
@@ -2132,7 +2136,7 @@ describe("ngAnimate $animateCss", function() {
2132
2136
2133
2137
var style = element . attr ( 'style' ) ;
2134
2138
expect ( style ) . toContain ( '3000s' ) ;
2135
- expect ( element . css ( 'transition-timing-function' ) ) . toBeOneOf ( 'ease' , 'cubic-bezier(0.25, 0.1, 0.25, 1)' ) ;
2139
+ expect ( element . css ( 'transition-timing-function' ) ) . toBeOneOf ( 'ease' , CUBIC_BEZIER_EASE_EQUIVALENT ) ;
2136
2140
} ) ) ;
2137
2141
2138
2142
it ( "should be applied to a CSS keyframe animation directly if keyframes are detected within the CSS class" ,
@@ -2238,7 +2242,7 @@ describe("ngAnimate $animateCss", function() {
2238
2242
expect ( style ) . toMatch ( / a n i m a t i o n (?: - d u r a t i o n ) ? : \s * 4 s / ) ;
2239
2243
expect ( element . css ( 'transition-duration' ) ) . toMatch ( '4s' ) ;
2240
2244
expect ( element . css ( 'transition-property' ) ) . toMatch ( 'all' ) ;
2241
- expect ( element . css ( 'transition-timing-function' ) ) . toBeOneOf ( 'linear' , 'cubic-bezier(0, 0, 1, 1)' ) ;
2245
+ expect ( element . css ( 'transition-timing-function' ) ) . toBeOneOf ( 'linear' , CUBIC_BEZIER_LINEAR_EQUIVALENT ) ;
2242
2246
} ) ) ;
2243
2247
} ) ;
2244
2248
@@ -2569,7 +2573,7 @@ describe("ngAnimate $animateCss", function() {
2569
2573
inject ( function ( $animateCss , $rootElement ) {
2570
2574
2571
2575
var options = {
2572
- transitionStyle : '5.5s ease-in color' ,
2576
+ transitionStyle : '5.5s ease color' ,
2573
2577
duration : 4 ,
2574
2578
event : 'enter' ,
2575
2579
structural : true
@@ -2582,7 +2586,7 @@ describe("ngAnimate $animateCss", function() {
2582
2586
2583
2587
expect ( element . css ( 'transition-duration' ) ) . toMatch ( '4s' ) ;
2584
2588
expect ( element . css ( 'transition-property' ) ) . toMatch ( 'color' ) ;
2585
- expect ( element . css ( 'transition-timing-function' ) ) . toBeOneOf ( 'ease-in ' , 'cubic-bezier(0.42, 0, 1, 1)' ) ;
2589
+ expect ( element . css ( 'transition-timing-function' ) ) . toBeOneOf ( 'ease' , CUBIC_BEZIER_EASE_EQUIVALENT ) ;
2586
2590
} ) ) ;
2587
2591
2588
2592
it ( "should give priority to the provided delay value, but only update the delay style itself" ,
@@ -2835,7 +2839,7 @@ describe("ngAnimate $animateCss", function() {
2835
2839
2836
2840
expect ( element . css ( 'transition-duration' ) ) . toMatch ( '2.5s' ) ;
2837
2841
expect ( element . css ( 'transition-property' ) ) . toMatch ( 'all' ) ;
2838
- expect ( element . css ( 'transition-timing-function' ) ) . toBeOneOf ( 'ease' , 'cubic-bezier(0.25, 0.1, 0.25, 1)' ) ;
2842
+ expect ( element . css ( 'transition-timing-function' ) ) . toBeOneOf ( 'ease' , CUBIC_BEZIER_EASE_EQUIVALENT ) ;
2839
2843
} ) ) ;
2840
2844
2841
2845
it ( "should remove all inline transition styling when an animation completes" ,
@@ -2966,7 +2970,7 @@ describe("ngAnimate $animateCss", function() {
2966
2970
it ( "should apply a transition duration if the existing transition duration's property value is not 'all'" ,
2967
2971
inject ( function ( $animateCss , $rootElement ) {
2968
2972
2969
- ss . addRule ( '.ng-enter' , 'transition: 1s cubic-bezier(0.25, 0.1, 0.25, 1) color' ) ;
2973
+ ss . addRule ( '.ng-enter' , 'transition: 1s linear color' ) ;
2970
2974
2971
2975
var emptyObject = { } ;
2972
2976
var options = {
@@ -2982,7 +2986,7 @@ describe("ngAnimate $animateCss", function() {
2982
2986
2983
2987
expect ( element . css ( 'transition-duration' ) ) . toMatch ( '1s' ) ;
2984
2988
expect ( element . css ( 'transition-property' ) ) . toMatch ( 'color' ) ;
2985
- expect ( element . css ( 'transition-timing-function' ) ) . toBe ( 'cubic-bezier(0.25, 0.1, 0.25, 1)' ) ;
2989
+ expect ( element . css ( 'transition-timing-function' ) ) . toBeOneOf ( 'linear' , CUBIC_BEZIER_LINEAR_EQUIVALENT ) ;
2986
2990
} ) ) ;
2987
2991
2988
2992
it ( "should apply a transition duration and an animation duration if duration + styles options are provided for a matching keyframe animation" ,
0 commit comments