From d5e53909c66aa92b00fa6bd7211043d69fec2105 Mon Sep 17 00:00:00 2001 From: Jorge Padawan Date: Wed, 17 Feb 2021 13:32:09 +0100 Subject: [PATCH] Fixed test --- modules/supplier/front/account/index.spec.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) 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', () => {