#8581 invoiceIn e2e #1452

Merged
jorgep merged 153 commits from 8581-invoiceinE2e into dev 2025-03-20 08:58:01 +00:00
3 changed files with 14 additions and 6 deletions
Showing only changes of commit f783aa43de - Show all commits

View File

@ -247,7 +247,7 @@ onBeforeMount(async () => {
<QItemSection>{{ t('components.smartCard.downloadFile') }}</QItemSection>
</QItem>
<QDialog ref="correctionDialogRef">
<QCard>
<QCard data-cy="correctiveInvoiceDialog">
<QCardSection>
<QItem class="q-px-none">
<span class="text-primary text-h6 full-width">

View File

@ -128,9 +128,14 @@ function createCorrective(opts = {}) {
const { type, reason, class: classVal } = opts;
cy.selectDescriptorOption(4);
cy.selectOption('[data-cy="invoiceInDescriptorMenu_class"]', classVal);
cy.selectOption('[data-cy="invoiceInDescriptorMenu_type"]', type);
cy.selectOption('[data-cy="invoiceInDescriptorMenu_reason"]', reason);
cy.fillInForm(
{
invoiceInDescriptorMenu_class: { val: classVal, type: 'select' },
invoiceInDescriptorMenu_type: { val: type, type: 'select' },
invoiceInDescriptorMenu_reason: { val: reason, type: 'select' },
},
{ form: '[data-cy="correctiveInvoiceDialog"]', attr: 'data-cy' },
);
cy.dataCy('saveCorrectiveInvoice').click();
cy.wait('@corrective').then(({ response }) => {

View File

@ -123,8 +123,11 @@ function selectItem(selector, option, ariaControl, hasWrite = true) {
const val = typeof option == 'string' ? option.toLowerCase() : option;
return item.innerText.toLowerCase().includes(val);
});
if (matchingItem) return cy.wrap(matchingItem).click();
if (matchingItem) {
cy.wrap(matchingItem).click();
cy.get('#' + ariaControl).should('not.exist');
return;
}
if (hasWrite) cy.get(selector).clear().type(option);
return selectItem(selector, option, ariaControl, false);
});