You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
it('should not submit if form is still validating',()=>{constonSubmit=jest.fn()constform=createForm({ onSubmit });constusername=jest.fn()form.registerField('username',username,{error: true},{getValidator: ()=>()=>{returnnewPromise(resolve=>resolve('Error'))}})form.submit()expect(onSubmit).not.toHaveBeenCalled()})
The text was updated successfully, but these errors were encountered:
What is the current behavior?
If there's any async validation happening, onSubmit will be called regardless of their status.
What is the expected behavior?
onSubmit shouldn't be called until all validators have resolved. FormState.valid is true even though it might not be true.
Sandbox Link
https://codesandbox.io/s/lv3y8mzjm
What's your environment?
final-form@4.2.0
Other information
Failing test
The text was updated successfully, but these errors were encountered: