2018-05-23 12:26:51 +00:00
|
|
|
import './index';
|
2018-03-01 10:55:28 +00:00
|
|
|
|
|
|
|
describe('Client', () => {
|
|
|
|
describe('Component vnClientRecoveryCreate', () => {
|
|
|
|
let $componentController;
|
|
|
|
let $scope;
|
|
|
|
let $state;
|
|
|
|
let controller;
|
|
|
|
|
2019-09-13 14:09:14 +00:00
|
|
|
beforeEach(angular.mock.module('client', $translateProvider => {
|
|
|
|
$translateProvider.translations('en', {});
|
|
|
|
}));
|
2018-03-01 10:55:28 +00:00
|
|
|
|
|
|
|
beforeEach(angular.mock.inject((_$componentController_, $rootScope, _$state_) => {
|
|
|
|
$componentController = _$componentController_;
|
|
|
|
$scope = $rootScope.$new();
|
|
|
|
$state = _$state_;
|
|
|
|
$scope.watcher = {
|
|
|
|
submit: () => {
|
|
|
|
return {
|
|
|
|
then: callback => {
|
|
|
|
callback();
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
|
|
|
};
|
|
|
|
controller = $componentController('vnClientRecoveryCreate', {$scope: $scope});
|
|
|
|
}));
|
|
|
|
|
|
|
|
describe('onSubmit()', () => {
|
|
|
|
it('should call the function go() on $state to go to the recovery list', () => {
|
|
|
|
spyOn($state, 'go');
|
|
|
|
controller.onSubmit();
|
|
|
|
|
2018-05-24 13:02:38 +00:00
|
|
|
expect(controller.$state.go).toHaveBeenCalledWith('client.card.recovery.index');
|
2018-03-01 10:55:28 +00:00
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|