Compare commits
3 Commits
dev
...
Hotfix-Cus
Author | SHA1 | Date |
---|---|---|
|
c0f19b3131 | |
|
0691d5e966 | |
|
9ee69274ae |
|
@ -47,7 +47,9 @@ export function useValidator() {
|
|||
return !validator.isEmpty(value ? String(value) : '') || message;
|
||||
},
|
||||
required: (required, value) => {
|
||||
return required ? !!value || t('globals.fieldRequired') : null;
|
||||
return required
|
||||
? value === 0 || !!value || t('globals.fieldRequired')
|
||||
: null;
|
||||
},
|
||||
length: (value) => {
|
||||
const options = {
|
||||
|
|
|
@ -7,7 +7,27 @@ describe('Client credits', () => {
|
|||
timeout: 5000,
|
||||
});
|
||||
});
|
||||
it('Should load layout', () => {
|
||||
|
||||
it('Should put a new credit', () => {
|
||||
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');
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue