Runs in a real DOM. Each test seeds a
<form id="signup">before calling your function.
Implement validateForm() that validates every <input> inside #signup against its own attributes:
required: the value must be non-empty after trimming.type="email": a non-empty value must look likename@domain.tld.minlength="N": a non-empty value must have at least N characters (an empty optional field is fine - same as the browser).
For each invalid input set aria-invalid="true" and put a non-empty message into the element with data-error-for="<input name>". For each valid input remove aria-invalid and clear that message (fields can start out already flagged).
Return { invalid, ariaInvalid }: invalid is the invalid field names in document order, and ariaInvalid is the names of the inputs whose aria-invalid attribute is "true" read back from the DOM after you are done.