fix: refs #8277 update tooltip text and add data-cy attributes for Cypress tests
gitea/salix-front/pipeline/pr-dev This commit looks good Details

This commit is contained in:
Jorge Penadés 2025-04-07 12:49:25 +02:00
parent 5c2c78a894
commit 5b80c22bae
2 changed files with 30 additions and 5 deletions

View File

@ -388,7 +388,7 @@ async function createInvoice(isAgricultural) {
:disable="!selectedRows.length"
@click="preAccount"
>
<QTooltip>{{ t('entry.preAccount.preAccount') }}</QTooltip>
<QTooltip>{{ t('entry.preAccount.btn') }}</QTooltip>
</QBtn>
<VnInputNumber
v-model="daysAgo"
@ -436,6 +436,7 @@ async function createInvoice(isAgricultural) {
>
<template #actions>
<QBtn
data-cy="updateFile_yes"
:label="t('globals.yes')"
color="primary"
@click="updateFile"
@ -443,6 +444,7 @@ async function createInvoice(isAgricultural) {
v-close-popup
/>
<QBtn
data-cy="updateFile_no"
:label="t('globals.no')"
color="primary"
flat

View File

@ -5,8 +5,15 @@ describe('Entry PreAccount Functionality', () => {
cy.visit('/#/entry/pre-account');
});
it('should handle entries with different suppliers or companies', () => {
cy.selectRows([1, 4]);
it.only('should handle entries with different suppliers or companies', () => {
cy.contains('[data-col-field="id"]', /^\s*3\s*$/)
.parent()
.find('td > .q-checkbox')
.click();
cy.contains('[data-col-field="id"]', /^\s*2\s*$/)
.parent()
.find('td:nth-child(1)')
.click();
cy.dataCy('preAccount_btn').click();
cy.checkNotification('Entries must have the same supplier and company');
});
@ -17,14 +24,30 @@ describe('Entry PreAccount Functionality', () => {
cy.checkNotification('It has been successfully pre-accounted');
});
it.only('should upload the document and pre-account', () => {
it("should ask to upload a doc. if it's not agricultural and doesn't have doc. ", () => {
cy.selectRows([1]);
cy.dataCy('preAccount_btn').click();
cy.dataCy('Reference_input').type('{selectall}234343fh', { delay: 0 });
cy.dataCy('VnDms_inputFile').selectFile('test/cypress/fixtures/image.jpg', {
force: true,
});
cy.get('[data-cy="FormModelPopup_save"]').click();
cy.checkNotification('It has been successfully pre-accounted');
});
it('should ask to inherit the doc. and open VnDms popup if user choose "no"', () => {
cy.selectRows([2]);
cy.dataCy('preAccount_btn').click();
cy.dataCy('updateFile_no').click();
cy.get('#formModel').should('be.visible');
});
it('should ask to inherit the doc. and open VnDms popup if user choose "yes" and pre-account', () => {
cy.selectRows([2]);
cy.dataCy('preAccount_btn').click();
cy.dataCy('updateFile_yes').click();
cy.checkNotification('It has been successfully pre-accounted');
});
});
function selectRowsByCol(col= 'id', values = [])