diff --git a/modules/supplier/front/account/index.spec.js b/modules/supplier/front/account/index.spec.js index d64baa016..ca1671207 100644 --- a/modules/supplier/front/account/index.spec.js +++ b/modules/supplier/front/account/index.spec.js @@ -11,7 +11,7 @@ describe('Supplier Component vnSupplierAccount', () => { $httpBackend = _$httpBackend_; $scope = $rootScope.$new(); $scope.bankEntity = { - show: () => {} + open: () => {} }; $element = angular.element(''); controller = $componentController('vnSupplierAccount', {$element, $scope}); @@ -28,26 +28,27 @@ describe('Supplier Component vnSupplierAccount', () => { preventDefault: () => {} }; jest.spyOn(event, 'preventDefault'); - jest.spyOn(controller.$.bankEntity, 'show'); + jest.spyOn(controller.$.bankEntity, 'open'); controller.showBankEntity(event); expect(event.preventDefault).not.toHaveBeenCalledWith(); - expect(controller.$.bankEntity.show).not.toHaveBeenCalledWith(); + expect(controller.$.bankEntity.open).not.toHaveBeenCalledWith(); }); - it('should call preventDefault() and show() when the default is not prevented', () => { + it('should call preventDefault() and open() when the default is not prevented', () => { const event = { defaultPrevented: false, preventDefault: () => {} }; + jest.spyOn(event, 'preventDefault'); - jest.spyOn(controller.$.bankEntity, 'show'); + jest.spyOn(controller.$.bankEntity, 'open'); controller.showBankEntity(event); expect(event.preventDefault).toHaveBeenCalledWith(); - expect(controller.$.bankEntity.show).toHaveBeenCalledWith(); + expect(controller.$.bankEntity.open).toHaveBeenCalledWith(); }); it('should request to create a new bank entity', () => {