Skip to content

Instantly share code, notes, and snippets.

@tanner-west
Last active April 13, 2022 18:28
Show Gist options
  • Save tanner-west/a747830c77f6dd8fea5397d7b496d2a8 to your computer and use it in GitHub Desktop.
Save tanner-west/a747830c77f6dd8fea5397d7b496d2a8 to your computer and use it in GitHub Desktop.
it('Should increment counter when button is pressed', () => {
const button = getByTestId(wrapper, 'increment-counter');
const counterTextBefore = getByTestId(wrapper, 'counter-text');
expect(counterTextBefore.props().children).toEqual(0);
button.props().onPress();
const counterTextAfter = getByTestId(wrapper, 'counter-text');
expect(counterTextAfter.props().children).toEqual(1);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment