Files
ionic-framework/js/ext/angular/test/directive/ionicCheckbox.unit.js
Andy Joslin 2c39a21498 feat(ionic): prefix all directives with ion-
BREAKING CHANGE: All directives are now prefixed with `ion-`.

For any directive you use, add the ionic prefix.

For example, change this HTML:

```html
<tabs>
  <tab title="home" href="/tab/home">
    <content>Hello!</content>
  </tab>
</tabs>
```

To this HTML:

```
<ion-tabs>
  <ion-tab title="home" href="/tab/home">
    <ion-content>Hello!</ion-content>
  </ion-tab>
</ion-tabs>
```
2014-02-18 16:13:00 -05:00

31 lines
971 B
JavaScript

describe('Ionic Checkbox', function() {
var el, scope, compile;
beforeEach(module('ionic.ui.checkbox'));
beforeEach(inject(function($compile, $rootScope) {
compile = $compile;
scope = $rootScope;
}));
it('should set the checkbox name', function() {
el = compile('<ion-checkbox name="myname"></ion-checkbox>')(scope);
var input = el.find('input');
expect(input.attr('name')).toEqual('myname');
});
it('should setup checkbox markup', function() {
el = compile('<ion-checkbox>INNER TEXT</ion-checkbox>')(scope);
expect(el.hasClass('item')).toEqual(true);
expect(el.hasClass('item-checkbox')).toEqual(true);
var label = el.find('label');
expect(label.hasClass('checkbox')).toEqual(true);
var input = el.find('input');
expect(input.attr('type')).toEqual('checkbox');
var div = el.find('div');
expect(div.hasClass('item-content')).toEqual(true);
expect(div.text()).toEqual('INNER TEXT');
});
});