feat: refs #8163 maxLength SupplierFD account
gitea/salix-front/pipeline/pr-dev This commit looks good Details

This commit is contained in:
Javier Segarra 2024-11-22 08:54:41 +01:00
parent ce28757a1a
commit aae475bf4c
2 changed files with 6 additions and 9 deletions

View File

@ -106,6 +106,7 @@ function handleLocation(data, location) {
clearable clearable
data-cy="supplierFiscalDataAccount" data-cy="supplierFiscalDataAccount"
insertable insertable
:maxlength="10"
/> />
<VnSelect <VnSelect
:label="t('supplier.fiscalData.sageTaxTypeFk')" :label="t('supplier.fiscalData.sageTaxTypeFk')"

View File

@ -2,24 +2,20 @@ describe('VnInput Component', () => {
beforeEach(() => { beforeEach(() => {
cy.login('developer'); cy.login('developer');
cy.viewport(1920, 1080); cy.viewport(1920, 1080);
cy.visit('/#/supplier/1/fiscal-data');
cy.domContentLoad();
}); });
it('should replace character at cursor position in insert mode', () => { it('should replace character at cursor position in insert mode', () => {
cy.visit('/#/supplier/1/fiscal-data');
// Simula escribir en el input // Simula escribir en el input
cy.dataCy('supplierFiscalDataAccount').find('input').clear(); cy.dataCy('supplierFiscalDataAccount').find('input').clear();
cy.dataCy('supplierFiscalDataAccount').find('input').type('0123456789'); cy.dataCy('supplierFiscalDataAccount').find('input').type('4100000001');
// Activa el modo de inserción
cy.dataCy('supplierFiscalDataAccount')
.find('input')
.trigger('keydown', { key: 'Insert' });
// Coloca el cursor en la posición 0 // Coloca el cursor en la posición 0
cy.dataCy('supplierFiscalDataAccount').find('input').type('{moveToStart}'); cy.dataCy('supplierFiscalDataAccount').find('input').type('{movetostart}');
// Escribe un número y verifica que se reemplace correctamente // Escribe un número y verifica que se reemplace correctamente
cy.dataCy('supplierFiscalDataAccount').find('input').type('999'); cy.dataCy('supplierFiscalDataAccount').find('input').type('999');
cy.dataCy('supplierFiscalDataAccount') cy.dataCy('supplierFiscalDataAccount')
.find('input') .find('input')
.should('have.value', '9993456789'); .should('have.value', '9990000001');
}); });
}); });