diff --git a/test/cypress/integration/vnComponent/VnAccountNumber.spec.js b/test/cypress/integration/vnComponent/VnAccountNumber.spec.js new file mode 100644 index 000000000..000c2151d --- /dev/null +++ b/test/cypress/integration/vnComponent/VnAccountNumber.spec.js @@ -0,0 +1,39 @@ +describe('VnInput Component', () => { + 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', () => { + // Simula escribir en el input + cy.dataCy('supplierFiscalDataAccount').clear(); + cy.dataCy('supplierFiscalDataAccount').type('4100000001'); + // Coloca el cursor en la posición 0 + cy.dataCy('supplierFiscalDataAccount').type('{movetostart}'); + // Escribe un número y verifica que se reemplace correctamente + cy.dataCy('supplierFiscalDataAccount').type('999'); + cy.dataCy('supplierFiscalDataAccount') + .should('have.value', '9990000001'); + }); + + it('should replace character at cursor position in insert mode', () => { + // Simula escribir en el input + cy.dataCy('supplierFiscalDataAccount').clear(); + cy.dataCy('supplierFiscalDataAccount').type('4100000001'); + // Coloca el cursor en la posición 0 + cy.dataCy('supplierFiscalDataAccount').type('{movetostart}'); + // Escribe un número y verifica que se reemplace correctamente en la posicion incial + cy.dataCy('supplierFiscalDataAccount').type('999'); + cy.dataCy('supplierFiscalDataAccount') + .should('have.value', '9990000001'); + }); + + it('should respect maxlength prop', () => { + cy.dataCy('supplierFiscalDataAccount').clear(); + cy.dataCy('supplierFiscalDataAccount').type('123456789012345'); + cy.dataCy('supplierFiscalDataAccount') + .should('have.value', '1234567890'); // asumiendo que maxlength es 10 + }); +}); diff --git a/test/cypress/integration/vnComponent/vnBreadcrumbs.spec.js b/test/cypress/integration/vnComponent/VnBreadcrumbs.spec.js similarity index 100% rename from test/cypress/integration/vnComponent/vnBreadcrumbs.spec.js rename to test/cypress/integration/vnComponent/VnBreadcrumbs.spec.js diff --git a/test/cypress/integration/vnComponent/vnLocation.spec.js b/test/cypress/integration/vnComponent/VnLocation.spec.js similarity index 100% rename from test/cypress/integration/vnComponent/vnLocation.spec.js rename to test/cypress/integration/vnComponent/VnLocation.spec.js diff --git a/test/cypress/integration/vnComponent/vnLog.spec.js b/test/cypress/integration/vnComponent/VnLog.spec.js similarity index 100% rename from test/cypress/integration/vnComponent/vnLog.spec.js rename to test/cypress/integration/vnComponent/VnLog.spec.js diff --git a/test/cypress/integration/vnComponent/vnSearchBar.spec.js b/test/cypress/integration/vnComponent/VnSearchBar.spec.js similarity index 100% rename from test/cypress/integration/vnComponent/vnSearchBar.spec.js rename to test/cypress/integration/vnComponent/VnSearchBar.spec.js diff --git a/test/cypress/integration/vnComponent/vnInput.spec.js b/test/cypress/integration/vnComponent/vnInput.spec.js deleted file mode 100644 index 75e06105f..000000000 --- a/test/cypress/integration/vnComponent/vnInput.spec.js +++ /dev/null @@ -1,42 +0,0 @@ -describe('VnInput Component', () => { - 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', () => { - // Simula escribir en el input - cy.dataCy('supplierFiscalDataAccount').find('input').clear(); - cy.dataCy('supplierFiscalDataAccount').find('input').type('4100000001'); - // Coloca el cursor en la posición 0 - 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', '9990000001'); - }); - - it('should replace character at cursor position in insert mode', () => { - // Simula escribir en el input - cy.dataCy('supplierFiscalDataAccount').find('input').clear(); - cy.dataCy('supplierFiscalDataAccount').find('input').type('4100000001'); - // Coloca el cursor en la posición 0 - cy.dataCy('supplierFiscalDataAccount').find('input').type('{movetostart}'); - // Escribe un número y verifica que se reemplace correctamente en la posicion incial - cy.dataCy('supplierFiscalDataAccount').find('input').type('999'); - cy.dataCy('supplierFiscalDataAccount') - .find('input') - .should('have.value', '9990000001'); - }); - - it('should respect maxlength prop', () => { - cy.dataCy('supplierFiscalDataAccount').find('input').clear(); - cy.dataCy('supplierFiscalDataAccount').find('input').type('123456789012345'); - cy.dataCy('supplierFiscalDataAccount') - .find('input') - .should('have.value', '1234567890'); // asumiendo que maxlength es 10 - }); -});