test(refresher): clean up last refresher patch's test

This commit is contained in:
Perry Govier
2014-09-25 16:20:58 -05:00
parent 8787760aad
commit 6495ff63ee

View File

@@ -4,6 +4,7 @@ describe('$ionicScroll Controller', function() {
beforeEach(function() {
ionic.Platform.ready = function(cb) { cb(); };
ionic.requestAnimationFrame = function(cb) { cb(); };
});
var scope, ctrl, timeout;
@@ -242,7 +243,6 @@ describe('$ionicScroll Controller', function() {
return { then: function(cb) { cb(); } };
};
});
it('scrollToRememberedPosition should work', inject(function($$scrollValueCache) {
spyOn(ctrl.scrollView, 'scrollTo');
$$scrollValueCache.foo = { left: 3, top: 4 };
@@ -380,20 +380,14 @@ describe('$ionicScroll Controller', function() {
expect(scope.$onPulling).toHaveBeenCalled();
refreshingCb();
expect(refresher.classList.contains('active')).toBe(true);
expect(refresher.classList.contains('refreshing')).toBe(false);
expect(scope.$onRefresh).not.toHaveBeenCalled();
doneCb();
expect(refresher.classList.contains('active')).toBe(true);
expect(refresher.classList.contains('refreshing')).toBe(true);
expect(scope.$onRefresh).toHaveBeenCalled();
timeout.flush();
expect(refresher.classList.contains('active')).toBe(false);
expect(refresher.classList.contains('refreshing')).toBe(false);
expect(refresher.classList.contains('invisible')).toBe(true);
showCb();
expect(refresher.classList.contains('invisible')).toBe(false);