Compare commits

...

6 Commits

Author SHA1 Message Date
Javier Segarra 7dcfeb0fc7 test: try to fix entryBuys test
gitea/salix-front/pipeline/pr-master This commit is unstable Details
2025-05-09 11:56:18 +02:00
Javier Segarra 1007a884b9 feat: remove reset selected variable
gitea/salix-front/pipeline/pr-master This commit is unstable Details
2025-05-08 12:25:59 +02:00
Jon Elias 9a33945662 Merge pull request 'Hotfix[UseValidator]: Make 0 become valid in VnInputNumber when using required from useValidator composable' (!1785) from Hotfix-CustomerCredits into master
gitea/salix-front/pipeline/head This commit looks good Details
Reviewed-on: #1785
Reviewed-by: Javier Segarra <jsegarra@verdnatura.es>
2025-05-08 10:10:56 +00:00
Jon Elias c0f19b3131 Merge branch 'master' into Hotfix-CustomerCredits
gitea/salix-front/pipeline/pr-master This commit looks good Details
2025-05-08 10:09:21 +00:00
Jon Elias 0691d5e966 Merge branch 'master' into Hotfix-CustomerCredits
gitea/salix-front/pipeline/pr-master This commit looks good Details
2025-05-07 11:09:49 +00:00
Jon Elias 9ee69274ae fix: make 0 become valid in VnInputNumber when using required from validator
gitea/salix-front/pipeline/pr-master This commit is unstable Details
2025-05-07 12:28:05 +02:00
5 changed files with 29 additions and 6 deletions

View File

@ -312,7 +312,6 @@ function stopEventPropagation(event) {
} }
function reload(params) { function reload(params) {
selected.value = [];
CrudModelRef.value.reload(params); CrudModelRef.value.reload(params);
} }

View File

@ -47,7 +47,9 @@ export function useValidator() {
return !validator.isEmpty(value ? String(value) : '') || message; return !validator.isEmpty(value ? String(value) : '') || message;
}, },
required: (required, value) => { required: (required, value) => {
return required ? !!value || t('globals.fieldRequired') : null; return required
? value === 0 || !!value || t('globals.fieldRequired')
: null;
}, },
length: (value) => { length: (value) => {
const options = { const options = {

View File

@ -7,7 +7,27 @@ describe('Client credits', () => {
timeout: 5000, timeout: 5000,
}); });
}); });
it('Should load layout', () => {
it('Should put a new credit', () => {
cy.get('.q-page').should('be.visible'); cy.get('.q-page').should('be.visible');
cy.dataCy('vnTableCreateBtn').click();
cy.dataCy('Credit_input').type('100');
cy.dataCy('FormModelPopup_save').click();
cy.checkNotification('Data saved');
});
it('Should put a new credit with value 0 to close the client card', () => {
cy.get('.q-page').should('be.visible');
cy.dataCy('vnTableCreateBtn').click();
cy.dataCy('Credit_input').type('0');
cy.dataCy('FormModelPopup_save').click();
cy.checkNotification('Data saved');
});
it('Should not create the credit if there is no value in the input', () => {
cy.get('.q-page').should('be.visible');
cy.dataCy('vnTableCreateBtn').click();
cy.dataCy('FormModelPopup_save').click();
cy.get('.q-notification__message').should('not.exist');
}); });
}); });

View File

@ -7,8 +7,8 @@ Cypress.Commands.add('selectTravel', (warehouse = '1') => {
}); });
Cypress.Commands.add('deleteEntry', () => { Cypress.Commands.add('deleteEntry', () => {
cy.get('[data-cy="descriptor-more-opts"]').should('be.visible').click(); cy.openActionsDescriptor();
cy.waitForElement('div[data-cy="delete-entry"]').click(); cy.get('[data-cy="delete-entry"]').click();
}); });
Cypress.Commands.add('createEntry', () => { Cypress.Commands.add('createEntry', () => {

View File

@ -94,8 +94,10 @@ describe('EntryBuys', () => {
cy.get('button[data-cy="vnTableCreateBtn"]').click(); cy.get('button[data-cy="vnTableCreateBtn"]').click();
cy.get('input[data-cy="itemFk-create-popup"]').type('1'); cy.get('input[data-cy="itemFk-create-popup"]').type('1');
cy.intercept('GET', /\/api\/Items\/1\/getVisibleAvailable/).as('item');
cy.get('div[role="listbox"] > div > div[role="option"]').eq(0).click(); cy.get('div[role="listbox"] > div > div[role="option"]').eq(0).click();
cy.wait('@item');
cy.get('input[data-cy="Grouping mode_select"]').should('have.value', 'packing'); cy.get('input[data-cy="Grouping mode_select"]').should('have.value', 'packing');
cy.get('button[data-cy="FormModelPopup_save"]').click(); cy.saveFormModel();
} }
}); });