chore(anchorScroll): remove a Jasmine toHaveBeenCalled workaround
The Jasmine fix landed long time ago and we've updated Jasmine since that happened.
This commit is contained in:
committed by
Pete Bacon Darwin
parent
1e3c7d2922
commit
dc8762eff1
@@ -87,15 +87,7 @@ describe('$anchorScroll', function() {
|
||||
|
||||
return function($window) {
|
||||
forEach(elmSpy, function(spy, id) {
|
||||
var count = map[id] || 0;
|
||||
// TODO(gkalpak): `toHaveBeenCalledTimes()` works correctly with 0 since
|
||||
// https://github.com/jasmine/jasmine/commit/342f0eb9a38194ecb8559e7df872c72afc0fe52e
|
||||
// Fix when we upgrade to a version that contains the fix.
|
||||
if (count > 0) {
|
||||
expect(spy).toHaveBeenCalledTimes(count);
|
||||
} else {
|
||||
expect(spy).not.toHaveBeenCalled();
|
||||
}
|
||||
expect(spy).toHaveBeenCalledTimes(map[id] || 0);
|
||||
});
|
||||
expect($window.scrollTo).not.toHaveBeenCalled();
|
||||
};
|
||||
@@ -401,14 +393,7 @@ describe('$anchorScroll', function() {
|
||||
|
||||
return function($rootScope, $window) {
|
||||
inject(expectScrollingTo(identifierCountMap));
|
||||
// TODO(gkalpak): `toHaveBeenCalledTimes()` works correctly with 0 since
|
||||
// https://github.com/jasmine/jasmine/commit/342f0eb9a38194ecb8559e7df872c72afc0fe52e
|
||||
// Fix when we upgrade to a version that contains the fix.
|
||||
if (list.length > 0) {
|
||||
expect($window.scrollBy).toHaveBeenCalledTimes(list.length);
|
||||
} else {
|
||||
expect($window.scrollBy).not.toHaveBeenCalled();
|
||||
}
|
||||
expect($window.scrollBy).toHaveBeenCalledTimes(list.length);
|
||||
forEach(list, function(offset, idx) {
|
||||
// Due to sub-pixel rendering, there is a +/-1 error margin in the actual offset
|
||||
var args = $window.scrollBy.calls.argsFor(idx);
|
||||
|
||||
Reference in New Issue
Block a user