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(); $scope.watcher = watcher; $element = angular.element(''); controller = $componentController('vnSupplierAgencyTermCreate', {$element, $scope}); })); describe('onSubmit()', () => { it(`should redirect to 'supplier.card.agencyTerm.index' state`, () => { jest.spyOn(controller.$state, 'go'); controller.onSubmit(); expect(controller.$state.go).toHaveBeenCalledWith('supplier.card.agencyTerm.index'); }); }); }); });