import React from 'react'; import { render, screen } from '@testing-library/react'; import { Bullseye } from '../Bullseye'; describe('Bullseye', () => { test('renders with PatternFly Core styles', () => { const { asFragment } = render(); expect(asFragment()).toMatchSnapshot(); }); test('className is added to the root element', () => { render(); expect(screen.getByTestId('test-id')).toHaveClass('extra-class'); }); test('allows passing in a string as the component', () => { const component = 'button'; render(); expect(screen.getByRole('button')).toBeInTheDocument(); }); test('allows passing in a React Component as the component', () => { const Component: React.FunctionComponent = () =>
Some text
; render(); expect(screen.getByText('Some text')).toBeInTheDocument(); }); });