blob: c67ad6bab48b488e093d1fd43f924963472bd21a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
import { render, screen } from '@test-utils';
import CommentForm from './comment-form';
const saveComment = async () => {
/** Do nothing. */
};
const title = 'Cum voluptas voluptatibus';
describe('CommentForm', () => {
it('renders a form', () => {
render(<CommentForm saveComment={saveComment} />);
expect(screen.getByRole('form')).toBeInTheDocument();
});
it('renders an optional title', () => {
render(
<CommentForm saveComment={saveComment} title={title} titleLevel={2} />
);
expect(
screen.getByRole('heading', { level: 2, name: title })
).toBeInTheDocument();
});
});
|