salix/modules/claim/front/development/index.spec.js

33 lines
1.0 KiB
JavaScript
Raw Normal View History

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-09-13 14:09:14 +00:00
beforeEach(angular.mock.module('claim', $translateProvider => {
$translateProvider.translations('en', {});
}));
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`, () => {
spyOn(controller.$state, 'go');
controller.onSubmit();
expect(controller.$state.go).toHaveBeenCalledWith('claim.card.action');
});
});
});
});