From 6c668131a4397cc7c51f1d6b3c26048f746d9fd1 Mon Sep 17 00:00:00 2001 From: Carlos Jimenez Ruiz Date: Thu, 27 Feb 2020 07:19:42 +0100 Subject: [PATCH] replaced returnValur for returnThis --- front/core/components/watcher/watcher.spec.js | 2 +- modules/client/front/balance/index/index.spec.js | 4 ++-- modules/client/front/credit-insurance/index/index.spec.js | 2 +- modules/client/front/summary/index.spec.js | 2 +- modules/route/front/tickets/index.spec.js | 2 +- modules/ticket/front/descriptor/index.spec.js | 2 +- modules/ticket/front/sale/specs/index.spec.js | 2 +- modules/worker/front/time-control/index.spec.js | 6 +++--- 8 files changed, 11 insertions(+), 11 deletions(-) diff --git a/front/core/components/watcher/watcher.spec.js b/front/core/components/watcher/watcher.spec.js index bad55b8702..6c2567f7e2 100644 --- a/front/core/components/watcher/watcher.spec.js +++ b/front/core/components/watcher/watcher.spec.js @@ -28,7 +28,7 @@ describe('Component vnWatcher', () => { it('should call fetchData() if controllers get and url properties are defined', () => { controller.get = () => {}; controller.url = 'test.com'; - jest.spyOn(controller, 'fetchData').mockReturnValue('ok!'); + jest.spyOn(controller, 'fetchData').mockReturnThis(); controller.$onInit(); expect(controller.fetchData).toHaveBeenCalledWith(); diff --git a/modules/client/front/balance/index/index.spec.js b/modules/client/front/balance/index/index.spec.js index 265c3176b6..aaa12b2e3a 100644 --- a/modules/client/front/balance/index/index.spec.js +++ b/modules/client/front/balance/index/index.spec.js @@ -45,7 +45,7 @@ describe('Client', () => { describe('company setter/getter', () => { it('should return the company and then call getData()', () => { - jest.spyOn(controller, 'getData').mockReturnValue('ok!'); + jest.spyOn(controller, 'getData').mockReturnThis(); controller.companyId = 442; expect(controller._companyId).toEqual(442); @@ -115,7 +115,7 @@ describe('Client', () => { }); it('should set the balances data and then call the getBalances() method', () => { - jest.spyOn(controller, 'getBalances').mockReturnValue('ok!'); + jest.spyOn(controller, 'getBalances').mockReturnThis(); controller.balances = [{ id: 1, debit: 1000, diff --git a/modules/client/front/credit-insurance/index/index.spec.js b/modules/client/front/credit-insurance/index/index.spec.js index b6a86e5dd4..48403263e1 100644 --- a/modules/client/front/credit-insurance/index/index.spec.js +++ b/modules/client/front/credit-insurance/index/index.spec.js @@ -72,7 +72,7 @@ describe('Client', () => { describe('returnDialog()', () => { it('should call the returnDialog method and perform a PATCH query, then call _getClassifications method', () => { - jest.spyOn(controller, '_getClassifications').mockReturnValue('ok!'); + jest.spyOn(controller, '_getClassifications').mockReturnThis(); controller.classificationId = 1; $httpBackend.when('PATCH', `CreditClassifications/1`).respond(200); $httpBackend.expect('PATCH', `CreditClassifications/1`); diff --git a/modules/client/front/summary/index.spec.js b/modules/client/front/summary/index.spec.js index 4835a01aff..15607008a9 100644 --- a/modules/client/front/summary/index.spec.js +++ b/modules/client/front/summary/index.spec.js @@ -17,7 +17,7 @@ describe('Client', () => { it('should perform a GET query and then define the summary property', () => { let res = {name: 'Superman', classifications: []}; - jest.spyOn(controller, 'sumRisk').mockReturnValue('ok!'); + jest.spyOn(controller, 'sumRisk').mockReturnThis(); $httpBackend.when('GET', `Clients/101/summary`).respond(200, res); $httpBackend.expect('GET', `Clients/101/summary`); diff --git a/modules/route/front/tickets/index.spec.js b/modules/route/front/tickets/index.spec.js index e9278d031d..d1313dd659 100644 --- a/modules/route/front/tickets/index.spec.js +++ b/modules/route/front/tickets/index.spec.js @@ -159,7 +159,7 @@ describe('Route', () => { describe('removeTicketFromRoute()', () => { it('should perform a patch query then call showSuccess and updateVolume methods', () => { - jest.spyOn(controller, 'updateVolume').mockReturnValue('ok!'); + jest.spyOn(controller, 'updateVolume').mockReturnThis(); jest.spyOn(controller.vnApp, 'showSuccess'); let ticketId = 1; controller.selectedTicket = ticketId; diff --git a/modules/ticket/front/descriptor/index.spec.js b/modules/ticket/front/descriptor/index.spec.js index 645a9fcf1e..a435618333 100644 --- a/modules/ticket/front/descriptor/index.spec.js +++ b/modules/ticket/front/descriptor/index.spec.js @@ -119,7 +119,7 @@ describe('Ticket Component vnTicketDescriptor', () => { describe('makeInvoice()', () => { it('should make a query and call $state.reload() method if the response is accept', () => { - jest.spyOn(controller.$state, 'reload').mockReturnValue('ok!'); + jest.spyOn(controller.$state, 'reload').mockReturnThis(); jest.spyOn(controller.vnApp, 'showSuccess'); $httpBackend.when('POST', 'Tickets/2/makeInvoice').respond(); diff --git a/modules/ticket/front/sale/specs/index.spec.js b/modules/ticket/front/sale/specs/index.spec.js index ed5b5c733f..57ca1d2959 100644 --- a/modules/ticket/front/sale/specs/index.spec.js +++ b/modules/ticket/front/sale/specs/index.spec.js @@ -110,7 +110,7 @@ describe('Ticket', () => { let filter = {where: {code: 'OK'}, fields: ['id']}; filter = encodeURIComponent(JSON.stringify(filter)); let res = [{id: 3}]; - jest.spyOn(controller, 'onStateChange').mockReturnValue('ok!'); + jest.spyOn(controller, 'onStateChange').mockReturnThis(); $httpBackend.whenGET(`States?filter=${filter}`).respond(res); $httpBackend.expectGET(`Tickets/1/subtotal`).respond(200, 227.5); diff --git a/modules/worker/front/time-control/index.spec.js b/modules/worker/front/time-control/index.spec.js index faa234c4fd..7987c6a50a 100644 --- a/modules/worker/front/time-control/index.spec.js +++ b/modules/worker/front/time-control/index.spec.js @@ -20,7 +20,7 @@ describe('Component vnWorkerTimeControl', () => { describe('date() setter', () => { it(`should set the weekDays, the date in the controller and call fetchHours`, () => { let today = new Date(); - jest.spyOn(controller, 'fetchHours').mockReturnValue('ok!'); + jest.spyOn(controller, 'fetchHours').mockReturnThis(); controller.date = today; @@ -35,7 +35,7 @@ describe('Component vnWorkerTimeControl', () => { describe('hours() setter', () => { it(`should set hours data at it's corresponding week day`, () => { let today = new Date(); - jest.spyOn(controller, 'fetchHours').mockReturnValue('ok!'); + jest.spyOn(controller, 'fetchHours').mockReturnThis(); controller.date = today; @@ -66,7 +66,7 @@ describe('Component vnWorkerTimeControl', () => { describe('getWorkedHours() ', () => { it('should set the weekdays expected and worked hours plus the total worked hours', () => { let today = new Date(); - jest.spyOn(controller, 'fetchHours').mockReturnValue('ok!'); + jest.spyOn(controller, 'fetchHours').mockReturnThis(); controller.date = today;