import { render, screen } from '@testing-library/react';
import '@testing-library/jest-dom';
import styles from '@patternfly/react-styles/css/components/Hint/hint';
import { HintTitle } from '../HintTitle';
test('renders without children', () => {
render();
expect(screen.getByTestId('HintTitle')).toBeVisible();
});
test('renders children', () => {
render({});
expect(screen.getByRole('button', { name: 'Test Me' })).toBeVisible();
});
test(`renders with class ${styles.hintTitle}`, () => {
render(Hint Body Test);
const body = screen.getByText('Hint Body Test');
expect(body).toHaveClass(styles.hintTitle);
});
test('renders with custom class names provided via prop', () => {
render(Hint Body Test);
const body = screen.getByText('Hint Body Test');
expect(body).toHaveClass('custom-classname');
});
test('renders with inherited element props spread to the component', () => {
render(Test);
expect(screen.getByText('Test')).toHaveAccessibleName('labelling-id');
});
test('matches snapshot', () => {
const { asFragment } = render({});
expect(asFragment()).toMatchSnapshot();
});