import { fireEvent, render } from '@testing-library/react-native' import * as React from 'react' import CircleButton from 'src/components/CircleButton' describe('CircleButton', () => { it('renders correctly with minimum props', () => { const tree = render() expect(tree).toMatchSnapshot() }) describe('when given optional props', () => { it('renders correctly', () => { const tree = render( ) expect(tree).toMatchSnapshot() }) }) describe('when pressed', () => { it('calls the onPress prop', () => { const onPress = jest.fn() const { UNSAFE_getByType } = render() fireEvent.press(UNSAFE_getByType(CircleButton)) expect(onPress).toHaveBeenCalled() }) }) })