fix: refs #8581 update data-cy attributes and improve test assertions in InvoiceIn components
gitea/salix-front/pipeline/pr-dev This commit is unstable Details

This commit is contained in:
Jorge Penadés 2025-03-06 15:03:32 +01:00
parent 1233f0724c
commit 5b81836ab2
6 changed files with 15 additions and 8 deletions

View File

@ -202,6 +202,9 @@ function setCursor(ref) {
:option-label="col.optionLabel"
:filter-options="['id', 'name']"
:tooltip="t('Create a new expense')"
:acls="[
{ model: 'Expense', props: '*', accessType: 'WRITE' },
]"
@keydown.tab.prevent="
autocompleteExpense(
$event,

View File

@ -40,7 +40,7 @@ describe('InvoiceInDescriptor', () => {
cy.visit('/#/invoice-in/6/summary');
cy.selectDescriptorOption(5);
cy.get('input[data-cy="SendEmailNotifiactionDialogInput"]').type(
cy.dataCy('SendEmailNotifiactionDialogInput_input').type(
'{selectall}jorgito@gmail.mx',
);
cy.clickConfirm();

View File

@ -161,14 +161,21 @@ describe('InvoiceInList', () => {
});
it('should filter by correctingFk param', () => {
let correctiveCount;
let noCorrectiveCount;
cy.dataCy('vnCheckboxRectificative').click();
cy.get('[data-cy="vnTable"] .q-virtual-scroll__content')
.children()
.should('have.length', 0);
.its('length')
.then((len) => (correctiveCount = len));
cy.dataCy('vnCheckboxRectificative').click();
cy.get('[data-cy="vnTable"] .q-virtual-scroll__content')
.children()
.should('have.length.gt', 0);
.its('length')
.then((len) => (noCorrectiveCount = len));
expect(correctiveCount).to.not.equal(noCorrectiveCount);
});
});
});

View File

@ -12,10 +12,7 @@ describe('InvoiceInSummary', () => {
});
it('should open the supplier descriptor popup', () => {
cy.intercept('GET', /InvoiceIns\/4.*/).as('getInvoice');
cy.intercept('GET', /Suppliers\/\d+/).as('getSupplier');
cy.wait('@getInvoice');
cy.dataCy('invoiceInSummary_supplier').then(($el) => {
const description = $el.text().trim();
$el.click();

View File

@ -18,7 +18,7 @@ describe('InvoiceInVat', () => {
cy.get(vats).eq(0).should('have.value', '8: H.P. IVA 21% CEE');
});
it('should add a new row', () => {
it.only('should add a new row', () => {
cy.addRow();
cy.fillRow(thirdRow, [true, 2000000001, 30, 'H.P. IVA 10']);
cy.saveCard();

View File

@ -121,7 +121,7 @@ function selectItem(selector, option, ariaControl, hasWrite = true) {
getItems(ariaControl).then((items) => {
const matchingItem = items
.toArray()
.find((item) => item.innerText.toLowerCase().includes(option.toLowerCase()));
.find((item) => item.innerText.toLowerCase().includes(option?.toLowerCase()));
if (matchingItem) return cy.wrap(matchingItem).click();
if (hasWrite) cy.get(selector).clear().type(option);