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