From fc60bff6ee33594dddf71fee4f4dd9ceaa4aee1c Mon Sep 17 00:00:00 2001 From: Nadiia Ridko <33199975+dandelionadia@users.noreply.github.com> Date: Fri, 27 Nov 2020 12:10:22 +0100 Subject: [PATCH] Update example-formik.md onSubmit has two arguments and we need to ignore the second one. (https://formik.org/docs/api/formik#onsubmit-values-values-formikbag-formikbag--void--promiseany) If we do not do this then we will get an error: ``` expect(jest.fn()).toHaveBeenCalledWith(...expected) - Expected + Received {"email": "email@example.com", "password": "password2398"}, + {"resetForm": [Function anonymous], "setErrors": [Function anonymous], "setFieldError": [Function anonymous], "setFieldTouched": [Function anonymous], "setFieldValue": [Function anonymous], "setFormikState": [Function anonymous], "setStatus": [Function anonymous], "setSubmitting": [Function anonymous], "setTouched": [Function anonymous], "setValues": [Function anonymous], "submitForm": [Function anonymous], "validateField": [Function anonymous], "validateForm": [Function anonymous]}, ``` --- docs/example-formik.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/example-formik.md b/docs/example-formik.md index 0da742a33..1d2486c5a 100644 --- a/docs/example-formik.md +++ b/docs/example-formik.md @@ -75,7 +75,7 @@ test('rendering and submiting a basic Formik form', async () => { email: 'jhon.dee@someemail.com', firstName: 'Jhon', lastName: 'Dee', - }) + }, expect.anything()) ) }) ```