feat(ionInfiniteScroll): allow configuration of icon

This commit is contained in:
Andy Joslin
2014-03-11 13:56:08 -06:00
parent 703f68fb0b
commit 5f2c32ea9b
2 changed files with 34 additions and 3 deletions

View File

@@ -32,7 +32,7 @@ describe('ionicInfiniteScroll directive', function() {
});
return element;
}
it('should error if no ionicScroll parent', function() {
expect(function() {
inject(function($compile, $rootScope) {
@@ -47,6 +47,28 @@ describe('ionicInfiniteScroll directive', function() {
expect(ctrl.isLoading).toBe(false);
});
describe('icon', function() {
it('should have default icon ion-loading-d', function() {
var el = setup();
var icon = angular.element(el[0].querySelector('.icon'));
expect(icon.hasClass('ion-loading-d')).toBe(true);
});
it('should allow icon attr blank', function() {
var el = setup('icon=""');
var icon = angular.element(el[0].querySelector('.icon'));
expect(icon.hasClass('ion-loading-d')).toBe(false);
});
it('should allow interpolated icon attr', function() {
var el = setup('icon="{{someIcon}}"');
var icon = angular.element(el[0].querySelector('.icon'));
expect(icon.hasClass('ion-loading-d')).toBe(false);
el.scope().$apply('someIcon = "super-icon"');
expect(icon.hasClass('super-icon')).toBe(true);
});
});
describe('getMaxScroll', function() {
it('getMaxScroll should default to 1%', function() {
var el = setup();