Skip to content

Commit 295e287

Browse files
authored
Rename mockedOnSubmit to handleSubmit
1 parent d4d96e8 commit 295e287

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

docs/example-formik.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ import userEvent from '@testing-library/user-event'
6161
import { MyForm } from './myForm.js'
6262

6363
test('rendering and submiting a basic Formik form', async () => {
64-
const mockedOnSubmit = jest.fn()
65-
render(<MyForm onSubmit={mockedOnSubmit} />)
64+
const handleSubmit = jest.fn()
65+
render(<MyForm onSubmit={handleSubmit} />)
6666

6767
userEvent.type(screen.getByLabelText(/first name/i), 'Jhon')
6868
userEvent.type(screen.getByLabelText(/last name/i), 'Dee')
@@ -71,7 +71,7 @@ test('rendering and submiting a basic Formik form', async () => {
7171
userEvent.click(screen.getByRole('button', { name: /submit/i }))
7272

7373
await waitFor(() =>
74-
expect(mockedOnSubmit).toHaveBeenCalledWith({
74+
expect(handleSubmit).toHaveBeenCalledWith({
7575
email: 'jhon.dee@someemail.com',
7676
firstName: 'Jhon',
7777
lastName: 'Dee',

0 commit comments

Comments
 (0)