4258-worker_time-control_tests #1014

Merged
carlosjr merged 11 commits from 4217-worker_time-control_tests into dev 2022-06-29 07:20:13 +00:00
Member
No description provided.
alexm added the
CR / Tests passed
label 2022-06-27 13:10:15 +00:00
alexm added 5 commits 2022-06-27 13:10:16 +00:00
alexm added 1 commit 2022-06-27 13:18:41 +00:00
gitea/salix/pipeline/head This commit looks good Details
50836a96f7
translate errors
carlosjr requested changes 2022-06-28 08:57:30 +00:00
@ -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',
Contributor

monthName es mas breve

monthName es mas breve
alexm marked this conversation as resolved
@ -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';
Contributor

eightAm

eightAm
alexm marked this conversation as resolved
@ -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",
Contributor

There is no existing contract

There is no existing contract
alexm marked this conversation as resolved
@ -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",
Contributor

si Direccion en este caso se refiere a "in", "middle" o "out", seria entonces: Wrong direction

si Direccion en este caso se refiere a "in", "middle" o "out", seria entonces: Wrong direction
alexm marked this conversation as resolved
@ -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() => {
Contributor

is himself (esto estaba mal)

is himself (esto estaba mal)
alexm marked this conversation as resolved
@ -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', () => {
Contributor

quitale el "as" en este contexto no tiene sentido.

quitale el "as" en este contexto no tiene sentido.
alexm marked this conversation as resolved
@ -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() => {
Contributor

user is absent
user has an absence

user is absent user has an absence
alexm marked this conversation as resolved
@ -195,2 +224,3 @@
});
expect(createdTimeEntry.id).toBeDefined();
it('should fail to add a time entry if worker no have business', async() => {
Contributor

should fail to add a time entry for a worker without an existing contract

should fail to add a time entry for a worker without an existing contract
alexm marked this conversation as resolved
@ -197,3 +247,2 @@
ctx.args = {direction: 'out'};
const updatedTimeEntry = await models.WorkerTimeControl.updateTimeEntry(ctx, createdTimeEntry.id, options);
describe('as direction errors', () => {
Contributor

quita "as"

quita "as"
alexm marked this conversation as resolved
@ -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() => {
Contributor

creo que quieres decir esto?

Should throw an error when trying "in" direction twice

creo que quieres decir esto? `Should throw an error when trying "in" direction twice`
alexm marked this conversation as resolved
@ -200,0 +275,4 @@
expect(error.message).toBe(`Dirección incorrecta`);
});
it('should return error when set in with in, middle', async() => {
Contributor

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

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`
alexm marked this conversation as resolved
@ -200,0 +308,4 @@
expect(error.message).toBe(`Dirección incorrecta`);
});
it('should return error when set out with in, middle', async() => {
Contributor

Should throw an error when trying "out" before closing a "middle" couple

`Should throw an error when trying "out" before closing a "middle" couple`
alexm marked this conversation as resolved
@ -200,0 +341,4 @@
expect(error.message).toBe(`Dirección incorrecta`);
});
it('should return error when set middle with in, out', async() => {
Contributor

Should throw an error when trying "middle" after "out"

`Should throw an error when trying "middle" after "out"`
alexm marked this conversation as resolved
@ -200,0 +374,4 @@
expect(error.message).toBe(`Dirección incorrecta`);
});
it('should return error when set out with in, out', async() => {
Contributor

Should throw an error when trying "out" direction twice

`Should throw an error when trying "out" direction twice`
alexm marked this conversation as resolved
@ -204,3 +411,1 @@
await tx.rollback();
throw e;
}
describe('as break 12h', () => {
Contributor

cambialo por '12h rest' (sin "as")

las traducciones que has usado usan la palabra "rest" y no "break"

cambialo por '12h rest' (sin "as") las traducciones que has usado usan la palabra "rest" y no "break"
alexm marked this conversation as resolved
@ -205,2 +411,2 @@
throw e;
}
describe('as break 12h', () => {
it('should return error when not fulfilled 12H break', async() => {
Contributor

`should throw when the 12h rest is not fulfilled yet'

`should throw when the 12h rest is not fulfilled yet'
alexm marked this conversation as resolved
@ -207,0 +443,4 @@
expect(error.message).toBe(`Descanso diario 12h.`);
});
it('should not fail when fulfilled 12H break', async() => {
Contributor

should not fail as the 12h rest is fulfilled

should not fail as the 12h rest is fulfilled
alexm marked this conversation as resolved
@ -207,0 +478,4 @@
});
});
describe('as break 9h for conductors of 3500kg', () => {
Contributor

for 3500kg drivers with enforced 9h rest

`for 3500kg drivers with enforced 9h rest`
alexm marked this conversation as resolved
@ -207,0 +479,4 @@
});
describe('as break 9h for conductors of 3500kg', () => {
it('should return error when not fulfilled 9H break', async() => {
Contributor

Que esta pasando con los returns? XD

'should throw when the 9h enforced rest is not fulfilled'

Que esta pasando con los returns? XD 'should throw when the 9h enforced rest is not fulfilled'
alexm marked this conversation as resolved
@ -207,0 +513,4 @@
expect(error.message).toBe(`Descanso diario 9h.`);
});
it('should not fail when fulfilled 9H break', async() => {
Contributor

solo por consistencia con la palabra rest

'Should not fail when the 9h enforced rest is fulfilled'

solo por consistencia con la palabra rest 'Should not fail when the 9h enforced rest is fulfilled'
alexm marked this conversation as resolved
@ -207,0 +548,4 @@
});
});
describe('as short break', () => {
Contributor

for 36h weekly rest

for 36h weekly rest
alexm marked this conversation as resolved
@ -207,0 +549,4 @@
});
describe('as short break', () => {
it('should return error when not fulfilled 36H week break', async() => {
Contributor

should throw when the 36h weekly rest is not fulfilled

should throw when the 36h weekly rest is not fulfilled
alexm marked this conversation as resolved
@ -207,0 +583,4 @@
expect(error.message).toBe(`Descanso semanal 36h. / 72h.`);
});
it('should return error when not fulfilled 36H week break again', async() => {
Contributor

este enunciado es confuso, esta dependiendo de data creada en otro "it" ?

este enunciado es confuso, esta dependiendo de data creada en otro "it" ?
alexm marked this conversation as resolved
@ -207,0 +615,4 @@
});
});
describe('as long break', () => {
Contributor

for 72h weekly rest

for 72h weekly rest
alexm marked this conversation as resolved
@ -207,0 +616,4 @@
});
describe('as long break', () => {
it('should return error when not fulfilled 72H week break', async() => {
Contributor

'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)

'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)
alexm marked this conversation as resolved
@ -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
Contributor

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.

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.
alexm marked this conversation as resolved
alexm added 2 commits 2022-06-28 10:10:48 +00:00
alexm requested review from carlosjr 2022-06-28 10:11:35 +00:00
carlosjr approved these changes 2022-06-28 10:44:59 +00:00
carlosjr left a comment
Contributor

LGTM

LGTM
carlosjr added 1 commit 2022-06-28 10:45:20 +00:00
gitea/salix/pipeline/head This commit is unstable Details
1981232df4
Merge branch 'dev' into 4217-worker_time-control_tests
carlosjr added 1 commit 2022-06-28 12:21:32 +00:00
gitea/salix/pipeline/head This commit is unstable Details
06eddd8e47
Merge branch 'dev' into 4217-worker_time-control_tests
alexm added 1 commit 2022-06-29 06:43:50 +00:00
gitea/salix/pipeline/head This commit looks good Details
f6b9327fb5
try
carlosjr approved these changes 2022-06-29 07:19:59 +00:00
carlosjr left a comment
Contributor

LGTM

LGTM
carlosjr merged commit 1b39446552 into dev 2022-06-29 07:20:13 +00:00
carlosjr deleted branch 4217-worker_time-control_tests 2022-06-29 07:20:13 +00:00
Sign in to join this conversation.
No reviewers
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: verdnatura/salix#1014
No description provided.