quick fixup

This commit is contained in:
Liam 2024-09-10 10:54:17 -04:00
parent 516f4a98fd
commit 2e88374ac1

View file

@ -214,7 +214,7 @@ describe('Image upload form', () => {
}); });
}); });
async function submitForm(frm): Promise<boolean> { async function submitForm(frm: HTMLFormElement): Promise<boolean> {
return new Promise(resolve => { return new Promise(resolve => {
function onSubmit() { function onSubmit() {
frm.removeEventListener('submit', onSubmit); frm.removeEventListener('submit', onSubmit);
@ -232,7 +232,7 @@ describe('Image upload form', () => {
it('should prevent form submission if tag checks fail', async () => { it('should prevent form submission if tag checks fail', async () => {
for (let i = 0; i < tagSets.length; i += 1) { for (let i = 0; i < tagSets.length; i += 1) {
taginputEl.value = tagSets[i]; taginputEl.innerText = tagSets[i];
if (await submitForm(form)) { if (await submitForm(form)) {
// form submit succeeded // form submit succeeded
@ -243,7 +243,7 @@ describe('Image upload form', () => {
}); });
} else { } else {
// form submit prevented // form submit prevented
frm = form; const frm = form;
await waitFor(() => { await waitFor(() => {
assertSubmitButtonIsEnabled(); assertSubmitButtonIsEnabled();
expect(frm.querySelectorAll('.help-block')).toHaveLength(tagErrorCounts[i]); expect(frm.querySelectorAll('.help-block')).toHaveLength(tagErrorCounts[i]);