blob: f11c449e483ef603cccaa35a38f51d958a40d5cc (
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 '../../../../tests/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();
});
});
|