import { render, screen } from '@testing-library/react'; import '@testing-library/jest-dom'; import styles from '@patternfly/react-styles/css/components/TextInputGroup/text-input-group'; import { TextInputGroupUtilities } from '../TextInputGroupUtilities'; describe('TextInputGroupUtilities', () => { it('renders without children', () => { render(); expect(screen.getByTestId('TextInputGroupUtilities')).toBeVisible(); }); it('renders the children', () => { render({}); expect(screen.getByRole('button', { name: 'Test' })).toBeVisible(); }); it(`renders with class ${styles.textInputGroupUtilities}`, () => { render(Test); const utilities = screen.getByText('Test'); expect(utilities).toHaveClass(styles.textInputGroupUtilities); }); it('matches the snapshot', () => { const { asFragment } = render({}); expect(asFragment()).toMatchSnapshot(); }); });