fix: update frontTest
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Vicent Llopis 2022-07-27 13:01:03 +02:00
parent 26f8996936
commit 21701601e3
1 changed files with 17 additions and 8 deletions

View File

@ -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('<vn-shelving-create></vn-shelving-create>');
beforeEach(inject(($componentController, $rootScope, _$state_) => {
$scope = $rootScope.$new();
$state = _$state_;
$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.$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});
});
});
});