From aae475bf4ce9571895a74cb1d7dc28d5d7466177 Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Fri, 22 Nov 2024 08:54:41 +0100 Subject: [PATCH] feat: refs #8163 maxLength SupplierFD account --- src/pages/Supplier/Card/SupplierFiscalData.vue | 1 + .../integration/vnComponent/vnInput.spec.js | 14 +++++--------- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/src/pages/Supplier/Card/SupplierFiscalData.vue b/src/pages/Supplier/Card/SupplierFiscalData.vue index bb00fe195..bd35c69c0 100644 --- a/src/pages/Supplier/Card/SupplierFiscalData.vue +++ b/src/pages/Supplier/Card/SupplierFiscalData.vue @@ -106,6 +106,7 @@ function handleLocation(data, location) { clearable data-cy="supplierFiscalDataAccount" insertable + :maxlength="10" /> { beforeEach(() => { cy.login('developer'); cy.viewport(1920, 1080); + cy.visit('/#/supplier/1/fiscal-data'); + cy.domContentLoad(); }); it('should replace character at cursor position in insert mode', () => { - cy.visit('/#/supplier/1/fiscal-data'); - // Simula escribir en el input cy.dataCy('supplierFiscalDataAccount').find('input').clear(); - cy.dataCy('supplierFiscalDataAccount').find('input').type('0123456789'); - // Activa el modo de inserción - cy.dataCy('supplierFiscalDataAccount') - .find('input') - .trigger('keydown', { key: 'Insert' }); + cy.dataCy('supplierFiscalDataAccount').find('input').type('4100000001'); // 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 cy.dataCy('supplierFiscalDataAccount').find('input').type('999'); cy.dataCy('supplierFiscalDataAccount') .find('input') - .should('have.value', '9993456789'); + .should('have.value', '9990000001'); }); });