Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trigger onReset when resetForm is called, not just handleReset #2201

Merged
merged 1 commit into from Jan 13, 2020
Merged

Trigger onReset when resetForm is called, not just handleReset #2201

merged 1 commit into from Jan 13, 2020

Conversation

Menardi
Copy link
Contributor

@Menardi Menardi commented Jan 13, 2020

Fixes #2191

I've moved the onReset logic from handleReset to resetForm, and adjusted the tests accordingly.

Ideally I would have liked to test that handleReset calls resetForm, but given how the tests are set up, jest.spyOn did not correctly spy on resetForm to check if it had been called. Any suggestions on how to do this would be great.

@vercel
Copy link

vercel bot commented Jan 13, 2020

This pull request is being automatically deployed with ZEIT Now (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://zeit.co/jared/formik-docs/hctgqeq8z
✅ Preview: https://formik-docs-git-fork-menardi-reset-form-onreset.jared.now.sh

@jaredpalmer jaredpalmer merged commit 8b21c3d into jaredpalmer:master Jan 13, 2020
@Menardi Menardi deleted the reset-form-onreset branch January 14, 2020 08:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Calling resetForm does not trigger onReset
2 participants