Last active
January 15, 2019 16:57
-
-
Save thomashagstrom/5e20985588231f5117602952613c21b2 to your computer and use it in GitHub Desktop.
Call async function in Jest test
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
it('Error label should contain `No userPool`', async () => { | |
const wrapper = TestRenderer.create(<CognitoLogin />); | |
const child = wrapper.root.findByProps({ iconName: 'sign-in' }); | |
await child.props.onPress(); | |
const errorLabel = wrapper.root.findByProps({ isCaption: true }); | |
expect(errorLabel.props.children).toBe('No userPool'); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment