diff --git a/src/components/common/VnInput.vue b/src/components/common/VnInput.vue
index 7979b6d6e..69291c311 100644
--- a/src/components/common/VnInput.vue
+++ b/src/components/common/VnInput.vue
@@ -1,5 +1,5 @@
@@ -89,6 +119,7 @@ const mixinRules = [
:type="$attrs.type"
:class="{ required: isRequired }"
@keyup.enter="emit('keyup.enter')"
+ @keydown="handleKeydown"
:clearable="false"
:rules="mixinRules"
:lazy-rules="true"
diff --git a/src/pages/Supplier/Card/SupplierFiscalData.vue b/src/pages/Supplier/Card/SupplierFiscalData.vue
index 547842960..7d07b900f 100644
--- a/src/pages/Supplier/Card/SupplierFiscalData.vue
+++ b/src/pages/Supplier/Card/SupplierFiscalData.vue
@@ -104,6 +104,7 @@ function handleLocation(data, location) {
v-model="data.account"
:label="t('supplier.fiscalData.account')"
clearable
+ data-cy="supplierFiscalDataAccount"
/>
{
+ beforeEach(() => {
+ cy.login('developer');
+ cy.viewport(1920, 1080);
+ });
+
+ 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' });
+ // 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', '9993456789');
+ });
+});
diff --git a/test/cypress/support/commands.js b/test/cypress/support/commands.js
index afe3561a0..b8c1d3988 100755
--- a/test/cypress/support/commands.js
+++ b/test/cypress/support/commands.js
@@ -310,3 +310,7 @@ Cypress.Commands.add('checkValueSelectForm', (id, search) => {
Cypress.Commands.add('searchByLabel', (label, value) => {
cy.get(`[label="${label}"] > .q-field > .q-field__inner`).type(`${value}{enter}`);
});
+
+Cypress.Commands.add('dataCy', (dataTestId, attr = 'data-cy') => {
+ return cy.get(`[${attr}="${dataTestId}"]`);
+});