DEV Community

Santhu90
Santhu90

Posted on

2

Redux Form“onSubmitSuccess” Unit Test

I am new to react, I need a help for writing a test case for Redux Form component "onSubmitSuccess", below is the code

reduxForm({ form: "AddTagForm",
enableReinitialize: true,
onSubmitSuccess: afterSubmit })

callback function,

export const afterSubmit = (dispatch) => dispatch(reset("AddTagForm"));
I need a help for writing a test case for afterSubmit method. Please help

Note: I am using jest with enzyme for unit testing.

Top comments (0)

Billboard image

Create up to 10 Postgres Databases on Neon's free plan.

If you're starting a new project, Neon has got your databases covered. No credit cards. No trials. No getting in your way.

Try Neon for Free →