diff --git a/modules/claim/front/descriptor/index.spec.js b/modules/claim/front/descriptor/index.spec.js index a64d5ecc1..4a78bda5a 100644 --- a/modules/claim/front/descriptor/index.spec.js +++ b/modules/claim/front/descriptor/index.spec.js @@ -3,14 +3,19 @@ import './index.js'; describe('Item Component vnClaimDescriptor', () => { let $httpParamSerializer; let $httpBackend; + let $element; + let $scope; let controller; beforeEach(ngModule('claim')); - beforeEach(angular.mock.inject(($componentController, _$httpBackend_, _$httpParamSerializer_) => { + beforeEach(angular.mock.inject(($componentController, $rootScope, _$httpBackend_, _$httpParamSerializer_) => { $httpBackend = _$httpBackend_; $httpParamSerializer = _$httpParamSerializer_; - controller = $componentController('vnClaimDescriptor'); + $scope = $rootScope.$new(); + + $element = angular.element(''); + controller = $componentController('vnClaimDescriptor', {$element, $scope}); controller.claim = {id: 2, clientFk: 101, client: {email: 'client@email'}}; })); @@ -31,13 +36,13 @@ describe('Item Component vnClaimDescriptor', () => { describe('confirmPickupOrder()', () => { it('should call confirmPickupOrder.show()', () => { - controller.$scope.confirmPickupOrder = { + controller.$.confirmPickupOrder = { show: jasmine.createSpy('show') }; controller.claim = {id: 2}; controller.confirmPickupOrder(); - expect(controller.$scope.confirmPickupOrder.show).toHaveBeenCalledWith(); + expect(controller.$.confirmPickupOrder.show).toHaveBeenCalledWith(); }); }); @@ -63,13 +68,13 @@ describe('Item Component vnClaimDescriptor', () => { describe('confirmDeleteClaim()', () => { it('should call confirmDeleteClaim.show()', () => { - controller.$scope.confirmDeleteClaim = { + controller.$.confirmDeleteClaim = { show: jasmine.createSpy('show') }; controller.claim = {id: 2}; controller.confirmDeleteClaim(); - expect(controller.$scope.confirmDeleteClaim.show).toHaveBeenCalledWith(); + expect(controller.$.confirmDeleteClaim.show).toHaveBeenCalledWith(); }); }); diff --git a/modules/worker/front/time-control/index.spec.js b/modules/worker/front/time-control/index.spec.js index 7987c6a50..519446864 100644 --- a/modules/worker/front/time-control/index.spec.js +++ b/modules/worker/front/time-control/index.spec.js @@ -1,6 +1,5 @@ import './index.js'; - describe('Component vnWorkerTimeControl', () => { let $httpBackend; let $scope; @@ -9,7 +8,7 @@ describe('Component vnWorkerTimeControl', () => { beforeEach(ngModule('worker')); - beforeEach(angular.mock.inject(($componentController, $compile, $rootScope, $stateParams, _$httpBackend_) => { + beforeEach(angular.mock.inject(($componentController, $rootScope, $stateParams, _$httpBackend_) => { $stateParams.id = 1; $httpBackend = _$httpBackend_; $scope = $rootScope.$new();