aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/organisms/forms/comment-form/comment-form.test.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/organisms/forms/comment-form/comment-form.test.tsx')
-rw-r--r--src/components/organisms/forms/comment-form/comment-form.test.tsx23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/components/organisms/forms/comment-form/comment-form.test.tsx b/src/components/organisms/forms/comment-form/comment-form.test.tsx
new file mode 100644
index 0000000..8aa38af
--- /dev/null
+++ b/src/components/organisms/forms/comment-form/comment-form.test.tsx
@@ -0,0 +1,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();
+ });
+});