26 lines
604 B
JavaScript
26 lines
604 B
JavaScript
describe('Component vnRadio', () => {
|
|
let $element;
|
|
let $ctrl;
|
|
let element;
|
|
|
|
beforeEach(ngModule('vnCore'));
|
|
|
|
beforeEach(inject(($compile, $rootScope) => {
|
|
$element = $compile(`<vn-radio val="myVal"></vn-radio`)($rootScope);
|
|
$ctrl = $element.controller('vnRadio');
|
|
element = $element[0];
|
|
}));
|
|
|
|
afterEach(() => {
|
|
$element.remove();
|
|
});
|
|
|
|
describe('field() setter', () => {
|
|
it(`should change field value when clicked`, () => {
|
|
element.click();
|
|
|
|
expect($ctrl.field).toEqual('myVal');
|
|
});
|
|
});
|
|
});
|