import { render, screen } from '@testing-library/react'; import { Tr } from '../Tr'; import styles from '@patternfly/react-styles/css/components/Table/table'; test('Renders without children', () => { render(
); expect(screen.getByRole('row')).toBeInTheDocument(); }); test('Renders with children', () => { render(
Row content
); expect(screen.getByRole('row')).toHaveTextContent('Row content'); }); test(`Does not render as hidden by default`, () => { render(
); expect(screen.getByRole('row')).not.toHaveAttribute('hidden'); }); test(`Renders as hidden when isHidden is true`, () => { render(
); expect(screen.queryByRole('row')).not.toBeInTheDocument(); }); test('Matches snapshot without children', () => { const { asFragment } = render(
); expect(asFragment()).toMatchSnapshot(); }); test('Matches snapshot with children', () => { const { asFragment } = render(
Row content
); expect(asFragment()).toMatchSnapshot(); });