mirror of
https://github.com/zhigang1992/angular.js.git
synced 2026-04-01 12:33:37 +08:00
fix($animate): ensure class-based animations are always skipped before structural post-digest tasks are run
Closes #5582
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user