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

Commit dc8762e

Browse files
mgolpetebacondarwin
authored andcommitted
chore(anchorScroll): remove a Jasmine toHaveBeenCalled workaround
The Jasmine fix landed long time ago and we've updated Jasmine since that happened.
1 parent 1e3c7d2 commit dc8762e

File tree

1 file changed

+2
-17
lines changed

1 file changed

+2
-17
lines changed

test/ng/anchorScrollSpec.js

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -87,15 +87,7 @@ describe('$anchorScroll', function() {
8787

8888
return function($window) {
8989
forEach(elmSpy, function(spy, id) {
90-
var count = map[id] || 0;
91-
// TODO(gkalpak): `toHaveBeenCalledTimes()` works correctly with 0 since
92-
// https://github.com/jasmine/jasmine/commit/342f0eb9a38194ecb8559e7df872c72afc0fe52e
93-
// Fix when we upgrade to a version that contains the fix.
94-
if (count > 0) {
95-
expect(spy).toHaveBeenCalledTimes(count);
96-
} else {
97-
expect(spy).not.toHaveBeenCalled();
98-
}
90+
expect(spy).toHaveBeenCalledTimes(map[id] || 0);
9991
});
10092
expect($window.scrollTo).not.toHaveBeenCalled();
10193
};
@@ -401,14 +393,7 @@ describe('$anchorScroll', function() {
401393

402394
return function($rootScope, $window) {
403395
inject(expectScrollingTo(identifierCountMap));
404-
// TODO(gkalpak): `toHaveBeenCalledTimes()` works correctly with 0 since
405-
// https://github.com/jasmine/jasmine/commit/342f0eb9a38194ecb8559e7df872c72afc0fe52e
406-
// Fix when we upgrade to a version that contains the fix.
407-
if (list.length > 0) {
408-
expect($window.scrollBy).toHaveBeenCalledTimes(list.length);
409-
} else {
410-
expect($window.scrollBy).not.toHaveBeenCalled();
411-
}
396+
expect($window.scrollBy).toHaveBeenCalledTimes(list.length);
412397
forEach(list, function(offset, idx) {
413398
// Due to sub-pixel rendering, there is a +/-1 error margin in the actual offset
414399
var args = $window.scrollBy.calls.argsFor(idx);

0 commit comments

Comments
 (0)