aboutsummaryrefslogtreecommitdiffstats
path: root/test/ngAnimate/animateSpec.js
diff options
context:
space:
mode:
authorMatias Niemelä2013-11-02 14:14:13 -0400
committerMatias Niemelä2013-11-05 21:44:02 -0500
commite53ff431e1472c0b2d5405d267d4e403ca31087e (patch)
treeec56bc60377f92abee1816872e96b701056c2d59 /test/ngAnimate/animateSpec.js
parent974b6d4a5b402c9911aef8adf2f3d30aae1ba8ed (diff)
downloadangular.js-e53ff431e1472c0b2d5405d267d4e403ca31087e.tar.bz2
fix($animate): ensure the active class is not applied if cancelled during reflow
Closes #4699
Diffstat (limited to 'test/ngAnimate/animateSpec.js')
-rw-r--r--test/ngAnimate/animateSpec.js23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/ngAnimate/animateSpec.js b/test/ngAnimate/animateSpec.js
index 207cfedb..ec37d8c3 100644
--- a/test/ngAnimate/animateSpec.js
+++ b/test/ngAnimate/animateSpec.js
@@ -1723,6 +1723,29 @@ describe("ngAnimate", function() {
});
});
+ it("should not perform the active class animation if the animation has been cancelled before the reflow occurs", function() {
+ inject(function($compile, $rootScope, $animate, $sniffer, $timeout) {
+ if(!$sniffer.transitions) return;
+
+ ss.addRule('.animated.ng-enter', '-webkit-transition: 2s linear all;' +
+ 'transition: 2s linear all;');
+
+ var element = html($compile('<div>...</div>')($rootScope));
+ var child = $compile('<div class="animated">...</div>')($rootScope);
+
+ $animate.enter(child, element);
+ $rootScope.$digest();
+
+ expect(child.hasClass('ng-enter')).toBe(true);
+
+ $animate.leave(child);
+ $rootScope.$digest();
+
+ $timeout.flush();
+ expect(child.hasClass('ng-enter-active')).toBe(false);
+ });
+ });
+
// it("should add and remove CSS classes and perform CSS animations during the process",
// inject(function($compile, $rootScope, $animate, $sniffer, $timeout) {
//