From 9470080762aecca5285d0f5cac4ae01540bbad4c Mon Sep 17 00:00:00 2001 From: Matias Niemelä Date: Wed, 6 Nov 2013 01:57:34 -0500 Subject: fix($animate): only apply the fallback property if any transition animations are detected --- test/ngAnimate/animateSpec.js | 49 ++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 48 insertions(+), 1 deletion(-) (limited to 'test/ngAnimate/animateSpec.js') diff --git a/test/ngAnimate/animateSpec.js b/test/ngAnimate/animateSpec.js index dee9bcba..562d94a0 100644 --- a/test/ngAnimate/animateSpec.js +++ b/test/ngAnimate/animateSpec.js @@ -814,7 +814,7 @@ describe("ngAnimate", function() { $timeout.flush(); expect(child.attr('style') || '').not.toContain('transition-property'); - expect(child.hasClass('ng-animate')).toBe(true); + expect(child.hasClass('ng-animate-start')).toBe(true); expect(child.hasClass('ng-animate-active')).toBe(true); browserTrigger(child,'transitionend', { timeStamp: Date.now() + 1000, elapsedTime: 1000 }); @@ -845,6 +845,53 @@ describe("ngAnimate", function() { expect(child2.hasClass('ng-animate-active')).toBe(false); })); + it("should not apply the fallback classes if no animations are going on or if CSS animations are going on", + inject(function($compile, $rootScope, $animate, $sniffer, $timeout) { + + if (!$sniffer.animations) return; + + ss.addRule('.transitions', '-webkit-transition:1s linear all;' + + 'transition:1s linear all'); + + ss.addRule('.keyframes', '-webkit-animation:my_animation 1s;' + + 'animation:my_animation 1s'); + + var element = $compile('