22
33describe ( "ngAnimate $animateCss" , function ( ) {
44
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+
59 beforeEach ( module ( 'ngAnimate' ) ) ;
610 beforeEach ( module ( 'ngAnimateMock' ) ) ;
711
@@ -710,7 +714,7 @@ describe("ngAnimate $animateCss", function() {
710714 triggerAnimationStartFrame ( ) ;
711715
712716 // 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 ) ;
714718 } ) ) ;
715719
716720
@@ -2033,7 +2037,7 @@ describe("ngAnimate $animateCss", function() {
20332037
20342038 var style = element . attr ( 'style' ) ;
20352039 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 ) ;
20372041 } ) ) ;
20382042
20392043 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() {
21392143 expect ( style ) . toMatch ( / a n i m a t i o n (?: - d u r a t i o n ) ? : \s * 4 s / ) ;
21402144 expect ( element . css ( 'transition-duration' ) ) . toMatch ( '4s' ) ;
21412145 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 ) ;
21432147 } ) ) ;
21442148 } ) ;
21452149
@@ -2470,7 +2474,7 @@ describe("ngAnimate $animateCss", function() {
24702474 inject ( function ( $animateCss , $rootElement ) {
24712475
24722476 var options = {
2473- transitionStyle : '5.5s ease-in color' ,
2477+ transitionStyle : '5.5s ease color' ,
24742478 duration : 4 ,
24752479 event : 'enter' ,
24762480 structural : true
@@ -2483,7 +2487,7 @@ describe("ngAnimate $animateCss", function() {
24832487
24842488 expect ( element . css ( 'transition-duration' ) ) . toMatch ( '4s' ) ;
24852489 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 ) ;
24872491 } ) ) ;
24882492
24892493 it ( "should give priority to the provided delay value, but only update the delay style itself" ,
@@ -2736,7 +2740,7 @@ describe("ngAnimate $animateCss", function() {
27362740
27372741 expect ( element . css ( 'transition-duration' ) ) . toMatch ( '2.5s' ) ;
27382742 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 ) ;
27402744 } ) ) ;
27412745
27422746 it ( "should remove all inline transition styling when an animation completes" ,
@@ -2867,7 +2871,7 @@ describe("ngAnimate $animateCss", function() {
28672871 it ( "should apply a transition duration if the existing transition duration's property value is not 'all'" ,
28682872 inject ( function ( $animateCss , $rootElement ) {
28692873
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' ) ;
28712875
28722876 var emptyObject = { } ;
28732877 var options = {
@@ -2883,7 +2887,7 @@ describe("ngAnimate $animateCss", function() {
28832887
28842888 expect ( element . css ( 'transition-duration' ) ) . toMatch ( '1s' ) ;
28852889 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 ) ;
28872891 } ) ) ;
28882892
28892893 it ( "should apply a transition duration and an animation duration if duration + styles options are provided for a matching keyframe animation" ,
0 commit comments