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

@@ -18,22 +18,22 @@
<h1 class="title">Input: Checkbox</h1>
</header>
<main class="content has-header">
<ion-content class="content has-header">
<ul class="list" ng-controller="MainCtrl">
<li class="item item-checkbox">
<li class="item item-checkbox checkbox-circle">
<label class="checkbox">
<input type="checkbox" checked>
</label>
Flux Capacitor
</li>
<li class="item item-checkbox">
<li class="item item-checkbox checkbox-square">
<label class="checkbox">
<input type="checkbox" checked>
</label>
1.21 Gigawatts
</li>
<li class="item item-checkbox">
<li class="item item-checkbox checkbox-platform">
<label class="checkbox">
<input type="checkbox" checked>
</label>
@@ -70,7 +70,7 @@
<ion-checkbox ng-model="test" ng-checked="test" class="checkbox-dark">Dark Directive</ion-checkbox>
</ul>
</main>
</ion-content>
<script type="text/javascript">
angular.module('ionicApp', ['ionic'])

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);
}));
});