import React from 'react';
import { render, screen } from '@testing-library/react';
import '@testing-library/jest-dom/extend-expect';
import Hint from './Hint';
describe('Hint component', () => {
test('renders without crashing', () => {
render();
});
test('renders the correct content', () => {
const content = 'This is a hint.';
render({content});
expect(screen.getByText(content)).toBeInTheDocument();
});
test('applies the passed class', () => {
const className = 'custom-class';
render(Hint with class);
expect(screen.getByText('Hint with class')).toHaveClass('govuk-hint', className);
});
test('applies the passed ID', () => {
const id = 'hint-id';
render(Hint with ID);
expect(screen.getByText('Hint with ID')).toHaveAttribute('id', id);
});
});