diff options
| author | Matias Niemelä | 2013-09-26 14:29:18 -0400 |
|---|---|---|
| committer | Brian Ford | 2013-09-30 10:59:28 -0700 |
| commit | 2df3c9f58def9584455f7c4bfdabbd12aab58bf9 (patch) | |
| tree | 1e6b553df8ca2e059e96d1c5db78a60530fd440d /test | |
| parent | 448bd14445e7f8a8aabaa555d43bbf7dff50d58d (diff) | |
| download | angular.js-2df3c9f58def9584455f7c4bfdabbd12aab58bf9.tar.bz2 | |
fix($animate): ensure transition-property is not changed when only keyframe animations are in use
Closes #3933
Diffstat (limited to 'test')
| -rw-r--r-- | test/ngAnimate/animateSpec.js | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/test/ngAnimate/animateSpec.js b/test/ngAnimate/animateSpec.js index adedeac4..a3a1d0b0 100644 --- a/test/ngAnimate/animateSpec.js +++ b/test/ngAnimate/animateSpec.js @@ -1270,6 +1270,36 @@ describe("ngAnimate", function() { expect(child.hasClass('ng-enter-active')).toBe(false); })); + it("should not set the transition property flag if only CSS animations are used", + inject(function($compile, $rootScope, $animate, $sniffer) { + + if (!$sniffer.animations) return; + + ss.addRule('.ani.ng-enter', 'my_animation 2s linear;' + + vendorPrefix + 'animation: my_animation 2s linear'); + + ss.addRule('.trans.ng-enter', 'transition:1s linear all;' + + vendorPrefix + 'transition:1s linear all'); + + var element = html($compile('<div>...</div>')($rootScope)); + var child = $compile('<div class="ani">...</div>')($rootScope); + child.css('transition-property','background-color'); + + $animate.enter(child, element); + $rootScope.$digest(); + + browserTrigger(child,'transitionend', { timeStamp: Date.now() + 2000 }); + + expect(child.css('transition-property')).toBe('background-color'); + child.remove(); + + child.attr('class','trans'); + $animate.enter(child, element); + $rootScope.$digest(); + + expect(child.css('transition-property')).not.toBe('background-color'); + })); + it("should skip animations if the browser does not support CSS3 transitions and CSS3 animations", inject(function($compile, $rootScope, $animate, $sniffer) { |
