misc updates with tests failing

This commit is contained in:
Mark Gregory
2026-06-29 09:42:00 +01:00
parent 7b40a55b0e
commit eaa8c6ebe3
6 changed files with 132 additions and 183 deletions
@@ -187,34 +187,14 @@ JS);
return (bool) $browser->script(<<<'JS'
const input = document.querySelector('#attachments');
const button = document.querySelector('[dusk="ticket-create-submit"], [data-dusk="ticket-create-submit"]');
const isVisible = (element) => {
if (! element) {
return false;
}
const style = window.getComputedStyle(element);
return style.display !== 'none'
&& style.visibility !== 'hidden'
&& style.opacity !== '0'
&& element.getClientRects().length > 0;
};
const visibleUploadText = Array.from(document.querySelectorAll('div, span'))
.some((element) => {
const text = (element.textContent || '').trim();
return (text.includes('Uploading attachments...') || text === 'Uploading...')
&& isVisible(element);
});
const selected = document.querySelector('[dusk="ticket-create-selected-attachments"], [data-dusk="ticket-create-selected-attachments"]');
return Boolean(input)
&& input.files.length > 0
&& Boolean(selected)
&& Boolean(button)
&& button.disabled === false
&& visibleUploadText === false;
&& button.disabled === false;
JS)[0];
}, 'The attachment upload did not finish before submit.');
}, 'The Livewire temporary attachment upload did not finish before submit.');
}
}