feat(checkbox): checkbox-square/platform updates

This commit is contained in:
Adam Bradley
2014-11-24 13:37:09 -06:00
parent 0951b97f06
commit 0c1b23d980
7 changed files with 76 additions and 28 deletions

View File

@@ -49,7 +49,6 @@ describe('Ionic Checkbox', function() {
expect(input[0].hasAttribute('checked')).toBe(true);
scope.$apply('shouldCheck = false');
expect(input[0].hasAttribute('checked')).toBe(false);
});
it('should ngChange properly', function() {
@@ -72,4 +71,16 @@ describe('Ionic Checkbox', function() {
expect(scope.change).toHaveBeenCalledWith(false);
});
it('should add config setting class', inject(function($ionicConfig){
$ionicConfig.form.checkbox('square');
el = compile('<ion-checkbox>')(scope);
scope.$apply();
expect(el[0].querySelector('.checkbox').classList.contains('checkbox-square')).toBe(true);
$ionicConfig.form.checkbox('circle');
el = compile('<ion-checkbox>')(scope);
scope.$apply();
expect(el[0].querySelector('.checkbox').classList.contains('checkbox-circle')).toBe(true);
}));
});