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
@@ -2033,7 +2037,7 @@ describe("ngAnimate $animateCss", function() {
2033
2037
2034
2038
var style = element . attr ( 'style' ) ;
2035
2039
expect ( style ) . toContain ( '3000s' ) ;
2036
- expect ( element . css ( 'transition-timing-function' ) ) . toBeOneOf ( 'ease' , 'cubic-bezier(0.25, 0.1, 0.25, 1)' ) ;
2040
+ expect ( element . css ( 'transition-timing-function' ) ) . toBeOneOf ( 'ease' , CUBIC_BEZIER_EASE_EQUIVALENT ) ;
2037
2041
} ) ) ;
2038
2042
2039
2043
it ( "should be applied to a CSS keyframe animation directly if keyframes are detected within the CSS class" ,
@@ -2139,7 +2143,7 @@ describe("ngAnimate $animateCss", function() {
2139
2143
expect ( style ) . toMatch ( / a n i m a t i o n (?: - d u r a t i o n ) ? : \s * 4 s / ) ;
2140
2144
expect ( element . css ( 'transition-duration' ) ) . toMatch ( '4s' ) ;
2141
2145
expect ( element . css ( 'transition-property' ) ) . toMatch ( 'all' ) ;
2142
- expect ( element . css ( 'transition-timing-function' ) ) . toBeOneOf ( 'linear' , 'cubic-bezier(0, 0, 1, 1)' ) ;
2146
+ expect ( element . css ( 'transition-timing-function' ) ) . toBeOneOf ( 'linear' , CUBIC_BEZIER_LINEAR_EQUIVALENT ) ;
2143
2147
} ) ) ;
2144
2148
} ) ;
2145
2149
@@ -2470,7 +2474,7 @@ describe("ngAnimate $animateCss", function() {
2470
2474
inject ( function ( $animateCss , $rootElement ) {
2471
2475
2472
2476
var options = {
2473
- transitionStyle : '5.5s ease-in color' ,
2477
+ transitionStyle : '5.5s ease color' ,
2474
2478
duration : 4 ,
2475
2479
event : 'enter' ,
2476
2480
structural : true
@@ -2483,7 +2487,7 @@ describe("ngAnimate $animateCss", function() {
2483
2487
2484
2488
expect ( element . css ( 'transition-duration' ) ) . toMatch ( '4s' ) ;
2485
2489
expect ( element . css ( 'transition-property' ) ) . toMatch ( 'color' ) ;
2486
- expect ( element . css ( 'transition-timing-function' ) ) . toBeOneOf ( 'ease-in ' , 'cubic-bezier(0.42, 0, 1, 1)' ) ;
2490
+ expect ( element . css ( 'transition-timing-function' ) ) . toBeOneOf ( 'ease' , CUBIC_BEZIER_EASE_EQUIVALENT ) ;
2487
2491
} ) ) ;
2488
2492
2489
2493
it ( "should give priority to the provided delay value, but only update the delay style itself" ,
@@ -2736,7 +2740,7 @@ describe("ngAnimate $animateCss", function() {
2736
2740
2737
2741
expect ( element . css ( 'transition-duration' ) ) . toMatch ( '2.5s' ) ;
2738
2742
expect ( element . css ( 'transition-property' ) ) . toMatch ( 'all' ) ;
2739
- expect ( element . css ( 'transition-timing-function' ) ) . toBeOneOf ( 'ease' , 'cubic-bezier(0.25, 0.1, 0.25, 1)' ) ;
2743
+ expect ( element . css ( 'transition-timing-function' ) ) . toBeOneOf ( 'ease' , CUBIC_BEZIER_EASE_EQUIVALENT ) ;
2740
2744
} ) ) ;
2741
2745
2742
2746
it ( "should remove all inline transition styling when an animation completes" ,
@@ -2867,7 +2871,7 @@ describe("ngAnimate $animateCss", function() {
2867
2871
it ( "should apply a transition duration if the existing transition duration's property value is not 'all'" ,
2868
2872
inject ( function ( $animateCss , $rootElement ) {
2869
2873
2870
- ss . addRule ( '.ng-enter' , 'transition: 1s cubic-bezier(0.25, 0.1, 0.25, 1) color' ) ;
2874
+ ss . addRule ( '.ng-enter' , 'transition: 1s linear color' ) ;
2871
2875
2872
2876
var emptyObject = { } ;
2873
2877
var options = {
@@ -2883,7 +2887,7 @@ describe("ngAnimate $animateCss", function() {
2883
2887
2884
2888
expect ( element . css ( 'transition-duration' ) ) . toMatch ( '1s' ) ;
2885
2889
expect ( element . css ( 'transition-property' ) ) . toMatch ( 'color' ) ;
2886
- expect ( element . css ( 'transition-timing-function' ) ) . toBe ( 'cubic-bezier(0.25, 0.1, 0.25, 1)' ) ;
2890
+ expect ( element . css ( 'transition-timing-function' ) ) . toBeOneOf ( 'linear' , CUBIC_BEZIER_LINEAR_EQUIVALENT ) ;
2887
2891
} ) ) ;
2888
2892
2889
2893
it ( "should apply a transition duration and an animation duration if duration + styles options are provided for a matching keyframe animation" ,
0 commit comments