import './index'; describe('Worker', () => { describe('Component vnNoteWorkerCreate', () => { let $state; let controller; beforeEach(ngModule('worker')); beforeEach(inject(($componentController, _$state_) => { $state = _$state_; $state.params.id = '1234'; const $element = angular.element(''); controller = $componentController('vnNoteWorkerCreate', {$element, $state}); })); it('should define workerFk using $state.params.id', () => { expect(controller.note.workerFk).toBe(1234); expect(controller.note.worker).toBe(undefined); }); }); });