salix/front/core/components/radio/index.spec.js

26 lines
604 B
JavaScript
Raw Normal View History

describe('Component vnRadio', () => {
2019-02-19 06:04:56 +00:00
let $element;
let $ctrl;
let element;
2019-02-19 06:04:56 +00:00
beforeEach(ngModule('vnCore'));
2019-02-19 06:04:56 +00:00
beforeEach(inject(($compile, $rootScope) => {
$element = $compile(`<vn-radio val="myVal"></vn-radio`)($rootScope);
$ctrl = $element.controller('vnRadio');
element = $element[0];
2019-02-19 06:04:56 +00:00
}));
afterEach(() => {
$element.remove();
});
describe('field() setter', () => {
it(`should change field value when clicked`, () => {
element.click();
2019-02-19 06:04:56 +00:00
expect($ctrl.field).toEqual('myVal');
2019-02-19 06:04:56 +00:00
});
});
});