4258-worker_time-control_tests #1014
No reviewers
Labels
No Milestone
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: verdnatura/salix#1014
Loading…
Reference in New Issue
No description provided.
Delete Branch "4217-worker_time-control_tests"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@ -951,3 +913,4 @@
weekWorkedHours: 'vn-worker-time-control vn-side-menu vn-label-value > section > span',
nextMonthButton: 'vn-worker-time-control vn-side-menu vn-calendar vn-button[icon=keyboard_arrow_right]',
previousMonthButton: 'vn-worker-time-control vn-side-menu vn-calendar vn-button[icon=keyboard_arrow_left]',
nameOfMonth: 'vn-worker-time-control vn-side-menu vn-calendar div > .title',
monthName es mas breve
@ -168,3 +20,1 @@
await page.autocompleteSearch(selectors.workerTimeControl.dialogTimeDirection, 'in');
await page.respondToDialog('accept');
const result = await page.waitToGetProperty(selectors.workerTimeControl.firstEntryOfWednesday, 'innerText');
const heightAm = '08:00';
eightAm
@ -126,2 +126,3 @@
"Not enough privileges to edit a client with verified data": "Not enough privileges to edit a client with verified data",
"Can't change the password of another worker": "Can't change the password of another worker"
"Can't change the password of another worker": "Can't change the password of another worker",
"No hay un contrato en vigor": "There is no contract in force",
There is no existing contract
@ -128,0 +127,4 @@
"Can't change the password of another worker": "Can't change the password of another worker",
"No hay un contrato en vigor": "There is no contract in force",
"No está permitido trabajar": "Not allowed to work",
"Dirección incorrecta": "Wrong address",
si Direccion en este caso se refiere a "in", "middle" o "out", seria entonces: Wrong direction
@ -57,3 +66,1 @@
it('should add if the current user is team boss and the target user is a himself', async() => {
activeCtx.accessToken.userId = teamBossId;
const workerId = teamBossId;
it('should add if the current user is team boss and the target user is a himself', async() => {
is himself (esto estaba mal)
@ -182,3 +202,1 @@
it('should edit the created time entry for the team boss as HHRR', async() => {
activeCtx.accessToken.userId = HHRRId;
const workerId = teamBossId;
describe('as WorkerTimeControl_clockIn calls', () => {
quitale el "as" en este contexto no tiene sentido.
@ -183,2 +202,2 @@
activeCtx.accessToken.userId = HHRRId;
const workerId = teamBossId;
describe('as WorkerTimeControl_clockIn calls', () => {
it('should fail to add a time entry if the target user has absent that day', async() => {
user is absent
user has an absence
@ -195,2 +224,3 @@
});
expect(createdTimeEntry.id).toBeDefined();
it('should fail to add a time entry if worker no have business', async() => {
should fail to add a time entry for a worker without an existing contract
@ -197,3 +247,2 @@
ctx.args = {direction: 'out'};
const updatedTimeEntry = await models.WorkerTimeControl.updateTimeEntry(ctx, createdTimeEntry.id, options);
describe('as direction errors', () => {
quita "as"
@ -198,2 +248,2 @@
ctx.args = {direction: 'out'};
const updatedTimeEntry = await models.WorkerTimeControl.updateTimeEntry(ctx, createdTimeEntry.id, options);
describe('as direction errors', () => {
it('should return error when set in with in', async() => {
creo que quieres decir esto?
Should throw an error when trying "in" direction twice
@ -200,0 +275,4 @@
expect(error.message).toBe(`Dirección incorrecta`);
});
it('should return error when set in with in, middle', async() => {
No creo que te este retornando un error, creo que te hara un throw.
Should throw an error when trying "in" direction twice with "middle" in between
@ -200,0 +308,4 @@
expect(error.message).toBe(`Dirección incorrecta`);
});
it('should return error when set out with in, middle', async() => {
Should throw an error when trying "out" before closing a "middle" couple
@ -200,0 +341,4 @@
expect(error.message).toBe(`Dirección incorrecta`);
});
it('should return error when set middle with in, out', async() => {
Should throw an error when trying "middle" after "out"
@ -200,0 +374,4 @@
expect(error.message).toBe(`Dirección incorrecta`);
});
it('should return error when set out with in, out', async() => {
Should throw an error when trying "out" direction twice
@ -204,3 +411,1 @@
await tx.rollback();
throw e;
}
describe('as break 12h', () => {
cambialo por '12h rest' (sin "as")
las traducciones que has usado usan la palabra "rest" y no "break"
@ -205,2 +411,2 @@
throw e;
}
describe('as break 12h', () => {
it('should return error when not fulfilled 12H break', async() => {
`should throw when the 12h rest is not fulfilled yet'
@ -207,0 +443,4 @@
expect(error.message).toBe(`Descanso diario 12h.`);
});
it('should not fail when fulfilled 12H break', async() => {
should not fail as the 12h rest is fulfilled
@ -207,0 +478,4 @@
});
});
describe('as break 9h for conductors of 3500kg', () => {
for 3500kg drivers with enforced 9h rest
@ -207,0 +479,4 @@
});
describe('as break 9h for conductors of 3500kg', () => {
it('should return error when not fulfilled 9H break', async() => {
Que esta pasando con los returns? XD
'should throw when the 9h enforced rest is not fulfilled'
@ -207,0 +513,4 @@
expect(error.message).toBe(`Descanso diario 9h.`);
});
it('should not fail when fulfilled 9H break', async() => {
solo por consistencia con la palabra rest
'Should not fail when the 9h enforced rest is fulfilled'
@ -207,0 +548,4 @@
});
});
describe('as short break', () => {
for 36h weekly rest
@ -207,0 +549,4 @@
});
describe('as short break', () => {
it('should return error when not fulfilled 36H week break', async() => {
should throw when the 36h weekly rest is not fulfilled
@ -207,0 +583,4 @@
expect(error.message).toBe(`Descanso semanal 36h. / 72h.`);
});
it('should return error when not fulfilled 36H week break again', async() => {
este enunciado es confuso, esta dependiendo de data creada en otro "it" ?
@ -207,0 +615,4 @@
});
});
describe('as long break', () => {
for 72h weekly rest
@ -207,0 +616,4 @@
});
describe('as long break', () => {
it('should return error when not fulfilled 72H week break', async() => {
'Should throw when the 72h weekly rest is not fulfilled yet'
'Should throw when the weekly rest is not fulfilled yet' (por contexto omito las horas)
@ -13,3 +13,3 @@
expect(result.expectedHours).toEqual(28800); // 8:00 hours in seconds
expect(result.workedHours).toEqual(28200); // 7:50 hours in seconds
expect(result.workedHours).toEqual(28800); // 8:00 hours in seconds
aqui puedes ver que las horas fichadas en las fixtures eran 7.5 y 8 para cerciorarnos de que el procedimiento no retorna por "casualidad" 8 en la propiedad erronea.
es bueno no tener todos los valores de un objeto al mismo valor para prevenir falsos negativos.
Como nota adicional cerciorate de que no retornas errores y usas throw y la palabra Should tiene la S en mayus que igual se me ha pasado alguna.
LGTM
LGTM