fix(scroll): cleanup native scroll listeners only if activated

This commit is contained in:
perry
2015-02-13 11:51:06 -06:00
parent be09433608
commit df6dcb96f6
2 changed files with 17 additions and 5 deletions

View File

@@ -126,4 +126,16 @@ describe('$ionicRefresh Controller', function() {
ctrl.getRefresherDomMethods().hide();
expect(refresher.classList.contains('invisible')).toBe(true);
});
it('should cleanup when done', function() {
setup();
expect(ctrl.__getScrollChild()).not.toBe(null);
expect(ctrl.__getScrollParent()).not.toBe(null);
scope.$broadcast('$destroy');
expect(ctrl.__getScrollChild()).toBe(null);
expect(ctrl.__getScrollParent()).toBe(null);
});
});