Created
March 19, 2019 18:47
-
-
Save hellosweta/af54c938d27383761ceff5119d903994 to your computer and use it in GitHub Desktop.
Simulating input changes in Enzyme and Formik
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const checkbox = form.find('input[name="agreementAccepted"]'); | |
checkbox.simulate('change', { | |
persist: () => {}, | |
target: { | |
checked: true, name: 'agreementAccepted' | |
} | |
}); | |
const contactNameInput = form.find('input[name="contactName"]'); | |
nameInput.simulate('change', { target: { value: '', name: 'name' } }); | |
const dropdown = form.find('input[name="product"]') | |
const showInfoCheckbox = form.find('input[name="shareInformation"]'); | |
showInfoCheckbox.simulate('click'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment