summaryrefslogtreecommitdiffstats
path: root/src/components/organisms/forms/comment-form.test.tsx
blob: 0d387b5681b090e51f24a631d88a797a70e5c6fd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import { render, screen } from '@test-utils';
import CommentForm from './comment-form';

const title = 'Cum voluptas voluptatibus';

describe('CommentForm', () => {
  it('renders a form', () => {
    render(<CommentForm saveComment={() => null} />);
    expect(screen.getByRole('form')).toBeInTheDocument();
  });

  it('renders an optional title', () => {
    render(
      <CommentForm saveComment={() => null} title={title} titleLevel={2} />
    );
    expect(
      screen.getByRole('heading', { level: 2, name: title })
    ).toBeInTheDocument();
  });
});