diff options
| author | Matias Niemelä | 2014-01-02 12:01:46 -0500 |
|---|---|---|
| committer | Matias Niemelä | 2014-01-03 12:14:15 -0500 |
| commit | bc492c0fc17257ddf2bc5964e205379aa766b3d8 (patch) | |
| tree | 821f69fc3ef97dacc403f299f3b5efad928132b5 /test | |
| parent | 162144202caa1bf42a576783f39d9145fa9b20ea (diff) | |
| download | angular.js-bc492c0fc17257ddf2bc5964e205379aa766b3d8.tar.bz2 | |
fix($animate): ensure class-based animations are always skipped before structural post-digest tasks are run
Closes #5582
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 15bb0f5c..c60639df 100644 --- a/test/ngAnimate/animateSpec.js +++ b/test/ngAnimate/animateSpec.js @@ -538,6 +538,27 @@ describe("ngAnimate", function() { expect(completed).toBe(true); })); + it("should skip class-based animations if animations are directly disabled on the same element", function() { + var capture; + module(function($animateProvider) { + $animateProvider.register('.capture', function() { + return { + addClass : function(element, className, done) { + capture = true; + done(); + } + }; + }); + }); + inject(function($animate, $rootScope, $sniffer, $timeout) { + $animate.enabled(true); + $animate.enabled(false, element); + + $animate.addClass(element, 'capture'); + expect(element.hasClass('capture')).toBe(true); + expect(capture).not.toBe(true); + }); + }); it("should fire the cancel/end function with the correct flag in the parameters", inject(function($animate, $rootScope, $sniffer, $timeout) { |
