2019-04-08 07:01:10 +00:00
|
|
|
import './index.js';
|
|
|
|
import watcher from 'core/mocks/watcher';
|
|
|
|
|
|
|
|
describe('Claim', () => {
|
|
|
|
describe('Component vnClaimBasicData', () => {
|
|
|
|
let controller;
|
|
|
|
let $scope;
|
|
|
|
|
2019-09-13 14:09:14 +00:00
|
|
|
beforeEach(angular.mock.module('claim', $translateProvider => {
|
|
|
|
$translateProvider.translations('en', {});
|
|
|
|
}));
|
2019-04-08 07:01:10 +00:00
|
|
|
|
|
|
|
beforeEach(angular.mock.inject(($componentController, $rootScope) => {
|
|
|
|
$scope = $rootScope.$new();
|
|
|
|
$scope.watcher = watcher;
|
|
|
|
let aclService = {hasAny: () => true};
|
|
|
|
controller = $componentController('vnClaimBasicData', {$scope, aclService});
|
|
|
|
}));
|
|
|
|
|
|
|
|
describe('onSubmit()', () => {
|
|
|
|
it(`should redirect to 'claim.card.detail' state`, () => {
|
|
|
|
spyOn(controller.$state, 'go');
|
|
|
|
controller.onSubmit();
|
|
|
|
|
|
|
|
expect(controller.$state.go).toHaveBeenCalledWith('claim.card.detail');
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|