2019-04-08 07:01:10 +00:00
|
|
|
import './index.js';
|
|
|
|
import watcher from 'core/mocks/watcher';
|
|
|
|
import crudModel from 'core/mocks/crud-model';
|
|
|
|
|
|
|
|
describe('Claim', () => {
|
|
|
|
describe('Component vnClaimDevelopment', () => {
|
|
|
|
let controller;
|
|
|
|
let $scope;
|
|
|
|
let aclService;
|
|
|
|
|
2019-10-24 22:53:53 +00:00
|
|
|
beforeEach(ngModule('claim'));
|
2019-04-08 07:01:10 +00:00
|
|
|
|
|
|
|
beforeEach(angular.mock.inject(($componentController, $rootScope) => {
|
|
|
|
$scope = $rootScope.$new();
|
|
|
|
$scope.watcher = watcher;
|
|
|
|
$scope.model = crudModel;
|
|
|
|
aclService = {hasAny: () => true};
|
|
|
|
controller = $componentController('vnClaimDevelopment', {$scope, aclService});
|
|
|
|
}));
|
|
|
|
|
|
|
|
describe('onSubmit()', () => {
|
|
|
|
it(`should redirect to 'claim.card.action' state`, () => {
|
2020-02-26 12:22:52 +00:00
|
|
|
jest.spyOn(controller.$state, 'go');
|
2019-04-08 07:01:10 +00:00
|
|
|
controller.onSubmit();
|
|
|
|
|
|
|
|
expect(controller.$state.go).toHaveBeenCalledWith('claim.card.action');
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|