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
gitea/salix-front/pipeline/pr-dev This commit is unstable
Details
This commit is contained in:
parent
5b81836ab2
commit
65a7ca1848
|
@ -18,7 +18,7 @@ describe('InvoiceInVat', () => {
|
|||
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.fillRow(thirdRow, [true, 2000000001, 30, 'H.P. IVA 10']);
|
||||
cy.saveCard();
|
||||
|
|
|
@ -119,9 +119,10 @@ function selectItem(selector, option, ariaControl, hasWrite = true) {
|
|||
if (!hasWrite) cy.wait(100);
|
||||
|
||||
getItems(ariaControl).then((items) => {
|
||||
const matchingItem = items
|
||||
.toArray()
|
||||
.find((item) => item.innerText.toLowerCase().includes(option?.toLowerCase()));
|
||||
const matchingItem = items.toArray().find((item) => {
|
||||
const val = typeof option == 'string' ? option.toLowerCase() : option;
|
||||
return item.innerText.toLowerCase().includes(val);
|
||||
});
|
||||
if (matchingItem) return cy.wrap(matchingItem).click();
|
||||
|
||||
if (hasWrite) cy.get(selector).clear().type(option);
|
||||
|
|
Loading…
Reference in New Issue