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;