From cbb2ad7f44032cbf96f5b190736dc527c0c8b7a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joan=20S=C3=A1nchez?= Date: Thu, 16 Jul 2020 11:59:16 +0200 Subject: [PATCH] Removed duplicated test --- modules/worker/front/calendar/index.spec.js | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) diff --git a/modules/worker/front/calendar/index.spec.js b/modules/worker/front/calendar/index.spec.js index 9ec4166d9..07e574d09 100644 --- a/modules/worker/front/calendar/index.spec.js +++ b/modules/worker/front/calendar/index.spec.js @@ -22,20 +22,6 @@ describe('Worker', () => { controller._worker = {id: 106}; })); - describe('worker() setter', () => { - it(`should set the data an then call the refresh() and getIsSubordinate() methods`, () => { - jest.spyOn(controller, 'refresh').mockReturnValue(new Promise(resolve => { - return resolve(); - })); - jest.spyOn(controller, 'getIsSubordinate').mockReturnValue(true); - - controller.worker = {id: 107}; - - expect(controller.refresh).toHaveBeenCalledWith(); - expect(controller.getIsSubordinate).toHaveBeenCalledWith(); - }); - }); - describe('started property', () => { it(`should return first day and month of current year`, () => { let started = new Date(year, 0, 1); @@ -64,7 +50,10 @@ describe('Worker', () => { describe('worker() setter', () => { it(`should perform a get query and set the reponse data on the model`, () => { - jest.spyOn(controller, 'getIsSubordinate').mockReturnThis(); + jest.spyOn(controller, 'getIsSubordinate').mockReturnValue(true); + jest.spyOn(controller, 'refresh').mockReturnValue(new Promise(resolve => { + return resolve(); + })); let today = new Date(); @@ -86,7 +75,7 @@ describe('Worker', () => { ] }); - controller.worker = {id: 1}; + controller.worker = {id: 107}; $httpBackend.flush(); let events = controller.events;