4856-worker.time-control #1375
|
@ -24,10 +24,13 @@ describe('Component vnCalendar', () => {
|
||||||
let nextMonth = new Date(date.getTime());
|
let nextMonth = new Date(date.getTime());
|
||||||
nextMonth.setMonth(nextMonth.getMonth() + 1);
|
nextMonth.setMonth(nextMonth.getMonth() + 1);
|
||||||
|
|
||||||
|
controller.getStates = jasmine.createSpy(controller, 'getStates');
|
||||||
|
|
||||||
controller.moveNext();
|
controller.moveNext();
|
||||||
|
|
||||||
expect(controller.month).toEqual(nextMonth.getMonth());
|
expect(controller.month).toEqual(nextMonth.getMonth());
|
||||||
expect(controller.emit).toHaveBeenCalledWith('move', {$date: nextMonth});
|
expect(controller.emit).toHaveBeenCalledWith('move', {$date: nextMonth});
|
||||||
|
expect(controller.getStates).toHaveBeenCalledWith({$day: nextMonth});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -37,6 +40,8 @@ describe('Component vnCalendar', () => {
|
||||||
let previousMonth = new Date(date.getTime());
|
let previousMonth = new Date(date.getTime());
|
||||||
previousMonth.setMonth(previousMonth.getMonth() - 1);
|
previousMonth.setMonth(previousMonth.getMonth() - 1);
|
||||||
|
|
||||||
|
controller.getStates = jasmine.createSpy(controller, 'getStates');
|
||||||
|
|
||||||
controller.movePrevious();
|
controller.movePrevious();
|
||||||
|
|
||||||
expect(controller.month).toEqual(previousMonth.getMonth());
|
expect(controller.month).toEqual(previousMonth.getMonth());
|
||||||
|
|
|
@ -96,8 +96,8 @@ describe('Component vnWorkerTimeControl', () => {
|
||||||
ended.setDate(ended.getDate() + 6);
|
ended.setDate(ended.getDate() + 6);
|
||||||
controller.ended = ended;
|
controller.ended = ended;
|
||||||
|
|
||||||
|
$httpBackend.expect('GET', `WorkerTimeControlMails`).respond({data: {state: 'SENDED'}});
|
||||||
controller.getWorkedHours(controller.started, controller.ended);
|
controller.getWorkedHours(controller.started, controller.ended);
|
||||||
|
|
||||||
$httpBackend.flush();
|
$httpBackend.flush();
|
||||||
|
|
||||||
expect(controller.weekDays.length).toEqual(7);
|
expect(controller.weekDays.length).toEqual(7);
|
||||||
|
|
Loading…
Reference in New Issue