Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save szaranger/c909fc4496b6b454b93f4e1007b50254 to your computer and use it in GitHub Desktop.
Save szaranger/c909fc4496b6b454b93f4e1007b50254 to your computer and use it in GitHub Desktop.
test('Clicking on + increments the number', () => {
// using React Testing Library
render(<Count />);
expect(screen.getByText('Total')).toBeInTheDocument();
userEvent.click(screen.getByText('Click'));
expect(screen.queryByText('1')).toBeInTheDocument();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment