Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

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

-1
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

+8
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)