diff options
| author | Armand Philippot <git@armandphilippot.com> | 2022-04-15 14:38:54 +0200 |
|---|---|---|
| committer | Armand Philippot <git@armandphilippot.com> | 2022-04-15 14:38:54 +0200 |
| commit | b836f0a9f8b783e3328983ad087aa2b7b297b43a (patch) | |
| tree | b2ef8841a3fc94a1fe400e53597f9338e5391858 /src/components/organisms/forms/comment-form.test.tsx | |
| parent | 0ff94252e27a80221e221c6159761f46aa111ac3 (diff) | |
chore: add a CommentForm component
Diffstat (limited to 'src/components/organisms/forms/comment-form.test.tsx')
| -rw-r--r-- | src/components/organisms/forms/comment-form.test.tsx | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/components/organisms/forms/comment-form.test.tsx b/src/components/organisms/forms/comment-form.test.tsx new file mode 100644 index 0000000..0d387b5 --- /dev/null +++ b/src/components/organisms/forms/comment-form.test.tsx @@ -0,0 +1,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(); + }); +}); |
