Created
January 13, 2019 12:10
-
-
Save thomashagstrom/39b93ce246aee869f3e66329c7d1922e to your computer and use it in GitHub Desktop.
Jest set React component state
This file contains 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 wrapper = TestRenderer.create(<CognitoLogin />); | |
const state: ICognitoLoginState = { | |
formState: 'Register', | |
code: 'testcode', | |
userInput: { email: 'bogus@test.com', password: 'testPw' }, | |
result: undefined, | |
}; | |
wrapper.root.instance.setState(state); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment