Skip to content

Commit 97a1b39

Browse files
committed
test($animate): add tests for noop enaled and cancel methods
1 parent c6bde52 commit 97a1b39

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

src/ng/animate.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@ var $AnimateProvider = ['$provide', function($provide) {
8888
// only serve one instance of a promise in order to save CPU cycles
8989
if (!currentDefer) {
9090
currentDefer = $$q.defer();
91-
currentDefer.promise.cancel = noop; //ngAnimate.$animate provides this
9291
$$asyncCallback(function() {
9392
currentDefer.resolve();
9493
currentDefer = null;

test/ng/animateSpec.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,14 @@ describe("$animate", function() {
7171
expect($animate.leave(element)).toBeAPromise();
7272
}));
7373

74+
it("should provide noop `enabled` and `cancel` methods", inject(function($animate) {
75+
expect($animate.enabled).toBe(angular.noop);
76+
expect($animate.enabled()).toBeUndefined();
77+
78+
expect($animate.cancel).toBe(angular.noop);
79+
expect($animate.cancel()).toBeUndefined();
80+
}));
81+
7482
it("should add and remove classes on SVG elements", inject(function($animate) {
7583
if (!window.SVGElement) return;
7684
var svg = jqLite('<svg><rect></rect></svg>');

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy