fix: refs #8581 update test case to remove 'only' and enhance item selection logic
gitea/salix-front/pipeline/pr-dev This commit is unstable Details

This commit is contained in:
Jorge Penadés 2025-03-06 16:01:17 +01:00
parent 5b81836ab2
commit 65a7ca1848
2 changed files with 5 additions and 4 deletions

View File

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

View File

@ -119,9 +119,10 @@ function selectItem(selector, option, ariaControl, hasWrite = true) {
if (!hasWrite) cy.wait(100); if (!hasWrite) cy.wait(100);
getItems(ariaControl).then((items) => { getItems(ariaControl).then((items) => {
const matchingItem = items const matchingItem = items.toArray().find((item) => {
.toArray() const val = typeof option == 'string' ? option.toLowerCase() : option;
.find((item) => item.innerText.toLowerCase().includes(option?.toLowerCase())); return item.innerText.toLowerCase().includes(val);
});
if (matchingItem) return cy.wrap(matchingItem).click(); if (matchingItem) return cy.wrap(matchingItem).click();
if (hasWrite) cy.get(selector).clear().type(option); if (hasWrite) cy.get(selector).clear().type(option);