salix/modules/claim/front/basic-data/index.spec.js

29 lines
978 B
JavaScript
Raw Normal View History

import './index.js';
import watcher from 'core/mocks/watcher';
describe('Claim', () => {
describe('Component vnClaimBasicData', () => {
let controller;
let $scope;
beforeEach(ngModule('claim'));
2020-07-23 14:46:16 +00:00
beforeEach(inject(($componentController, $rootScope) => {
$scope = $rootScope.$new();
$scope.watcher = watcher;
2020-03-16 10:58:14 +00:00
const $element = angular.element('<vn-claim-basic-data></vn-claim-basic-data>');
controller = $componentController('vnClaimBasicData', {$element, $scope});
}));
describe('onSubmit()', () => {
it(`should redirect to 'claim.card.detail' state`, () => {
2020-03-16 10:58:14 +00:00
jest.spyOn(controller.aclService, 'hasAny').mockReturnValue(true);
2020-02-26 12:22:52 +00:00
jest.spyOn(controller.$state, 'go');
controller.onSubmit();
expect(controller.$state.go).toHaveBeenCalledWith('claim.card.detail');
});
});
});
});