import './index.js'; describe('Component vnInputTime', () => { let $filter; let $element; let $ctrl; beforeEach(ngModule('vnCore')); beforeEach(inject(($compile, $rootScope, _$filter_) => { $filter = _$filter_; $element = $compile(``)($rootScope); $ctrl = $element.controller('vnInputTime'); })); afterEach(() => { $element.remove(); }); describe('field() setter', () => { it(`should display the formated the date`, () => { let date = Date.vnNew(); $ctrl.field = date; let displayed = $filter('date')(date, 'HH:mm'); expect($ctrl.value).toEqual(displayed); }); }); });