diff --git a/modules/shelving/front/create/index.spec.js b/modules/shelving/front/create/index.spec.js index 1642afc52..0bdde9145 100644 --- a/modules/shelving/front/create/index.spec.js +++ b/modules/shelving/front/create/index.spec.js @@ -1,17 +1,26 @@ import './index'; -import watcher from 'core/mocks/watcher'; -fdescribe('Shelving', () => { +describe('Shelving', () => { describe('Component vnShelvingCreate', () => { + let $scope; + let $state; let controller; - let $element; beforeEach(ngModule('shelving')); - beforeEach(inject(($componentController, $rootScope) => { - const $scope = $rootScope.$new(); - $scope.watcher = watcher; - $element = angular.element(''); + beforeEach(inject(($componentController, $rootScope, _$state_) => { + $scope = $rootScope.$new(); + $state = _$state_; + $scope.watcher = { + submit: () => { + return { + then: callback => { + callback({data: {id: 1}}); + } + }; + } + }; + const $element = angular.element(''); controller = $componentController('vnShelvingCreate', {$element, $scope}); controller.$params = {}; })); @@ -22,7 +31,7 @@ fdescribe('Shelving', () => { controller.onSubmit(); - expect(controller.$state.go).toHaveBeenCalledWith('shelving.card.basicData', {id: 1234}); + expect(controller.$state.go).toHaveBeenCalledWith('shelving.card.basicData', {id: 1}); }); }); });