diff --git a/src/pages/Worker/locale/en.yml b/src/pages/Worker/locale/en.yml
index 96df37919..865e86e7e 100644
--- a/src/pages/Worker/locale/en.yml
+++ b/src/pages/Worker/locale/en.yml
@@ -1,6 +1,11 @@
passwordRequirements: 'The password must have at least { length } length characters, {nAlpha} alphabetic characters, {nUpper} capital letters, {nDigits} digits and {nPunct} symbols (Ex: $%&.)\n'
tableColumns:
id: ID
- name: Name
+ firstName: First name
+ lastName: Last Name
+ userName: User Name
department: Department
email: Email
+ fi: FI
+ SSN: SSN
+ extension: Extension
diff --git a/src/pages/Worker/locale/es.yml b/src/pages/Worker/locale/es.yml
index 41812345f..b3c093ec5 100644
--- a/src/pages/Worker/locale/es.yml
+++ b/src/pages/Worker/locale/es.yml
@@ -6,6 +6,11 @@ External: Externo
passwordRequirements: 'La contraseña debe tener al menos { length } caracteres de longitud, {nAlpha} caracteres alfabéticos, {nUpper} letras mayúsculas, {nDigits} dígitos y {nPunct} símbolos (Ej: $%&.)'
tableColumns:
id: ID
- name: Nombre
+ firstName: Nombre
+ lastName: Apellidos
+ userName: Nombre de usuario
department: Departamento
email: Email
+ fi: NIF
+ SSN: NSS
+ extension: Extensión
diff --git a/src/pages/Zone/ZoneDeliveryPanel.vue b/src/pages/Zone/ZoneDeliveryPanel.vue
index d6c96b935..088811b01 100644
--- a/src/pages/Zone/ZoneDeliveryPanel.vue
+++ b/src/pages/Zone/ZoneDeliveryPanel.vue
@@ -94,7 +94,7 @@ watch(
url="Postcodes/location"
:fields="['geoFk', 'code', 'townFk', 'countryFk']"
sort-by="code, townFk"
- option-value="geoFk"
+ option-value="code"
option-label="code"
option-filter="code"
hide-selected
diff --git a/src/router/modules/worker.js b/src/router/modules/worker.js
index b2716474b..7258881be 100644
--- a/src/router/modules/worker.js
+++ b/src/router/modules/worker.js
@@ -168,6 +168,7 @@ export default {
meta: {
title: 'log',
icon: 'vn:History',
+ acls: [{ model: 'WorkerLog', props: 'find', accessType: 'READ' }],
},
component: () => import('src/pages/Worker/Card/WorkerLog.vue'),
},
diff --git a/test/cypress/integration/route/agency/agencyWorkCenter.spec.js b/test/cypress/integration/route/agency/agencyWorkCenter.spec.js
index 6d33dbc39..353c5805b 100644
--- a/test/cypress/integration/route/agency/agencyWorkCenter.spec.js
+++ b/test/cypress/integration/route/agency/agencyWorkCenter.spec.js
@@ -4,12 +4,12 @@ describe('AgencyWorkCenter', () => {
cy.login('developer');
cy.visit(`/#/agency/11/workCenter`);
});
+ const createButton = '.q-page-sticky > div > .q-btn > .q-btn__content > .q-icon';
+ const workCenterCombobox = 'input[role="combobox"]';
it('assign workCenter', () => {
- cy.get('.q-page-sticky > div > .q-btn > .q-btn__content > .q-icon').click();
- cy.get(
- '.vn-row > .q-field > .q-field__inner > .q-field__control > .q-field__control-container'
- ).type('workCenterOne{enter}');
+ cy.get(createButton).click();
+ cy.get(workCenterCombobox).type('workCenterOne{enter}');
cy.get('.q-notification__message').should('have.text', 'Data created');
});
@@ -22,12 +22,10 @@ describe('AgencyWorkCenter', () => {
});
it('error on duplicate workCenter', () => {
- cy.get('.q-page-sticky > div > .q-btn > .q-btn__content > .q-icon').click();
- cy.get(
- '.vn-row > .q-field > .q-field__inner > .q-field__control > .q-field__control-container'
- ).type('workCenterOne{enter}');
+ cy.get(createButton).click();
+ cy.get(workCenterCombobox).type('workCenterOne{enter}');
cy.get('.q-notification__message').should('have.text', 'Data created');
- cy.get('.q-page-sticky > div > .q-btn > .q-btn__content > .q-icon').click();
+ cy.get(createButton).click();
cy.get(
'.vn-row > .q-field > .q-field__inner > .q-field__control > .q-field__control-container'
).type('workCenterOne{enter}');
diff --git a/test/cypress/integration/route/routeList.spec.js b/test/cypress/integration/route/routeList.spec.js
index c9d7147c2..8020d3ea9 100644
--- a/test/cypress/integration/route/routeList.spec.js
+++ b/test/cypress/integration/route/routeList.spec.js
@@ -2,7 +2,7 @@ describe('Route', () => {
beforeEach(() => {
cy.viewport(1920, 1080);
cy.login('developer');
- cy.visit(`/#/route/list`);
+ cy.visit(`/#/route/extended-list`);
});
const getVnSelect =
'> :nth-child(1) > .column > .q-field > .q-field__inner > .q-field__control > .q-field__control-container';
diff --git a/test/vitest/__tests__/components/common/VnChangePassword.spec.js b/test/vitest/__tests__/components/common/VnChangePassword.spec.js
new file mode 100644
index 000000000..f5a967bb5
--- /dev/null
+++ b/test/vitest/__tests__/components/common/VnChangePassword.spec.js
@@ -0,0 +1,70 @@
+import { createWrapper, axios } from 'app/test/vitest/helper';
+import VnChangePassword from 'src/components/common/VnChangePassword.vue';
+import { vi, beforeEach, afterEach, beforeAll, describe, expect, it } from 'vitest';
+import { Notify } from 'quasar';
+
+describe('VnSmsDialog', () => {
+ let vm;
+
+ beforeAll(() => {
+ vi.spyOn(axios, 'get').mockResolvedValue({
+ data: [],
+ });
+ vm = createWrapper(VnChangePassword, {
+ propsData: {
+ submitFn: vi.fn(),
+ },
+ }).vm;
+ });
+
+ beforeEach(() => {
+ Notify.create = vi.fn();
+ });
+
+ afterEach(() => {
+ vi.clearAllMocks();
+ });
+
+ it('should notify when new password is empty', async () => {
+ vm.passwords.newPassword = '';
+ vm.passwords.repeatPassword = 'password';
+
+ await vm.validate();
+ expect(Notify.create).toHaveBeenCalledWith(
+ expect.objectContaining({
+ message: 'You must enter a new password',
+ type: 'negative',
+ })
+ );
+ });
+
+ it("should notify when passwords don't match", async () => {
+ vm.passwords.newPassword = 'password1';
+ vm.passwords.repeatPassword = 'password2';
+ await vm.validate();
+ expect(Notify.create).toHaveBeenCalledWith(
+ expect.objectContaining({
+ message: `Passwords don't match`,
+ type: 'negative',
+ })
+ );
+ });
+
+ describe('if passwords match', () => {
+ it('should call submitFn and emit password', async () => {
+ vm.passwords.newPassword = 'password';
+ vm.passwords.repeatPassword = 'password';
+ await vm.validate();
+ expect(vm.props.submitFn).toHaveBeenCalledWith('password', undefined);
+ });
+
+ it('should call submitFn and emit password and old password', async () => {
+ vm.passwords.newPassword = 'password';
+ vm.passwords.repeatPassword = 'password';
+ vm.passwords.oldPassword = 'oldPassword';
+
+ await vm.validate();
+ expect(vm.props.submitFn).toHaveBeenCalledWith('password', 'oldPassword');
+ });
+ });
+});