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

28 lines
697 B
JavaScript

describe('Component vnRadio', () => {
let $element;
let $ctrl;
let element;
beforeEach(angular.mock.module('vnCore', $translateProvider => {
$translateProvider.translations('en', {});
}));
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');
});
});
});