2022-03-15 08:36:48 +00:00
|
|
|
import './index';
|
|
|
|
import watcher from 'core/mocks/watcher';
|
|
|
|
|
|
|
|
describe('Supplier', () => {
|
|
|
|
describe('Component vnSupplierAddressCreate', () => {
|
|
|
|
let $scope;
|
|
|
|
let controller;
|
|
|
|
let $element;
|
|
|
|
|
|
|
|
beforeEach(ngModule('supplier'));
|
|
|
|
|
|
|
|
beforeEach(inject(($componentController, $rootScope, _$state_) => {
|
|
|
|
$scope = $rootScope.$new();
|
2022-03-17 13:51:49 +00:00
|
|
|
$scope.watcher = watcher;
|
|
|
|
$element = angular.element('<vn-supplier-agency-term-create></vn-supplier-agency-term-create>');
|
|
|
|
controller = $componentController('vnSupplierAgencyTermCreate', {$element, $scope});
|
2022-03-15 08:36:48 +00:00
|
|
|
}));
|
|
|
|
|
|
|
|
describe('onSubmit()', () => {
|
2022-03-17 13:51:49 +00:00
|
|
|
it(`should redirect to 'supplier.card.agencyTerm.index' state`, () => {
|
2022-03-15 08:36:48 +00:00
|
|
|
jest.spyOn(controller.$state, 'go');
|
|
|
|
controller.onSubmit();
|
|
|
|
|
2022-03-17 13:51:49 +00:00
|
|
|
expect(controller.$state.go).toHaveBeenCalledWith('supplier.card.agencyTerm.index');
|
2022-03-15 08:36:48 +00:00
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|