3069-client.shelving #1029

Merged
joan merged 16 commits from 3069-client.shelving into dev 2022-08-05 09:18:56 +00:00
1 changed files with 17 additions and 8 deletions
Showing only changes of commit 21701601e3 - Show all commits

View File

@ -1,17 +1,26 @@
import './index'; import './index';
import watcher from 'core/mocks/watcher';
fdescribe('Shelving', () => { describe('Shelving', () => {
describe('Component vnShelvingCreate', () => { describe('Component vnShelvingCreate', () => {
vicent marked this conversation as resolved
Review

fdescribe

fdescribe
let $scope;
let $state;
let controller; let controller;
let $element;
beforeEach(ngModule('shelving')); beforeEach(ngModule('shelving'));
beforeEach(inject(($componentController, $rootScope) => { beforeEach(inject(($componentController, $rootScope, _$state_) => {
const $scope = $rootScope.$new(); $scope = $rootScope.$new();
$scope.watcher = watcher; $state = _$state_;
$element = angular.element('<vn-shelving-create></vn-shelving-create>'); $scope.watcher = {
submit: () => {
return {
then: callback => {
callback({data: {id: 1}});
}
};
}
};
const $element = angular.element('<vn-shelving-create></vn-shelving-create>');
controller = $componentController('vnShelvingCreate', {$element, $scope}); controller = $componentController('vnShelvingCreate', {$element, $scope});
controller.$params = {}; controller.$params = {};
vicent marked this conversation as resolved
Review

de donde sale la id 1234? este test es raro

de donde sale la id 1234? este test es raro
})); }));
@ -22,7 +31,7 @@ fdescribe('Shelving', () => {
controller.onSubmit(); controller.onSubmit();
expect(controller.$state.go).toHaveBeenCalledWith('shelving.card.basicData', {id: 1234}); expect(controller.$state.go).toHaveBeenCalledWith('shelving.card.basicData', {id: 1});
}); });
}); });
}); });