fix test
This commit is contained in:
parent
7571cd6e1b
commit
116a34d04a
|
@ -43,18 +43,18 @@ describe('Worker absences()', () => {
|
|||
expect(sixthType).toEqual('Holidays');
|
||||
});
|
||||
|
||||
it(`should fire the worker 106 on July and see he/she has 14`, async() => {
|
||||
const firedWorker = await app.models.WorkerLabour.findById(106);
|
||||
it(`should fire the worker 106 on Juny and see he/she has 14`, async() => {
|
||||
let workerFk = 106;
|
||||
const firedWorker = await app.models.WorkerLabour.findById(workerFk);
|
||||
|
||||
const endedDate = new Date();
|
||||
endedDate.setHours(0, 0, 0, 0);
|
||||
endedDate.setDate(30);
|
||||
endedDate.setMonth(5);
|
||||
endedDate.setDate(31);
|
||||
endedDate.setHours(0, 0, 0, 0);
|
||||
|
||||
await firedWorker.updateAttributes({ended: endedDate});
|
||||
|
||||
let ctx = {req: {accessToken: {userId: 106}}};
|
||||
let workerFk = 106;
|
||||
let ctx = {req: {accessToken: {userId: 9}}};
|
||||
|
||||
const started = new Date();
|
||||
started.setHours(0, 0, 0, 0);
|
||||
|
@ -71,7 +71,7 @@ describe('Worker absences()', () => {
|
|||
let calendar = result[0];
|
||||
let absences = result[1];
|
||||
|
||||
expect(calendar.totalHolidays).toEqual(14);
|
||||
expect(calendar.totalHolidays).toEqual(13.5);
|
||||
expect(calendar.holidaysEnjoyed).toEqual(5);
|
||||
|
||||
let firstType = absences[0].absenceType().name;
|
||||
|
|
Loading…
Reference in New Issue