diff options
| author | Matias Niemelä | 2013-11-27 23:18:51 -0500 |
|---|---|---|
| committer | Matias Niemelä | 2013-12-04 19:26:40 -0500 |
| commit | 93901bdde4bb9f0ba114ebb33b8885808e1823e1 (patch) | |
| tree | e7b186e20b70ca8bfb3a9a07ee3fd3f501210a95 /test | |
| parent | d802ed1b3680cfc1751777fac465b92ee29944dc (diff) | |
| download | angular.js-93901bdde4bb9f0ba114ebb33b8885808e1823e1.tar.bz2 | |
fix($animate): ensure ms durations are properly rounded
Closes #5113
Closes #5162
Diffstat (limited to 'test')
| -rw-r--r-- | test/ngAnimate/animateSpec.js | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/test/ngAnimate/animateSpec.js b/test/ngAnimate/animateSpec.js index b4635bd0..b3068470 100644 --- a/test/ngAnimate/animateSpec.js +++ b/test/ngAnimate/animateSpec.js @@ -2852,5 +2852,26 @@ describe("ngAnimate", function() { $timeout.flush(); }); }); + + it('should round up long elapsedTime values to close off a CSS3 animation', + inject(function($rootScope, $compile, $rootElement, $document, $animate, $sniffer, $timeout, $window) { + if (!$sniffer.animations) return; + + ss.addRule('.millisecond-transition.ng-leave', '-webkit-transition:510ms linear all;' + + 'transition:510ms linear all;'); + + var element = $compile('<div class="millisecond-transition"></div>')($rootScope); + $rootElement.append(element); + jqLite($document[0].body).append($rootElement); + + $animate.leave(element); + $rootScope.$digest(); + + $timeout.flush(); + + browserTrigger(element, 'transitionend', { timeStamp: Date.now() + 1000, elapsedTime: 0.50999999991 }); + + expect($rootElement.children().length).toBe(0); + })); }); }); |
