summaryrefslogtreecommitdiffstats
path: root/src/components/organisms/forms/contact-form.test.tsx
diff options
context:
space:
mode:
authorArmand Philippot <git@armandphilippot.com>2022-04-15 14:49:41 +0200
committerArmand Philippot <git@armandphilippot.com>2022-04-15 14:49:41 +0200
commit64570357f9608ad6638b1f8cc283ee9dd1cc3264 (patch)
tree32d95b6299f4c8b220af728b2173f040e526edd6 /src/components/organisms/forms/contact-form.test.tsx
parentb836f0a9f8b783e3328983ad087aa2b7b297b43a (diff)
chore: add a ContactForm component
Diffstat (limited to 'src/components/organisms/forms/contact-form.test.tsx')
-rw-r--r--src/components/organisms/forms/contact-form.test.tsx46
1 files changed, 46 insertions, 0 deletions
diff --git a/src/components/organisms/forms/contact-form.test.tsx b/src/components/organisms/forms/contact-form.test.tsx
new file mode 100644
index 0000000..744f147
--- /dev/null
+++ b/src/components/organisms/forms/contact-form.test.tsx
@@ -0,0 +1,46 @@
+import { render, screen } from '@test-utils';
+import ContactForm from './contact-form';
+
+const props = {
+ sendMail: () => null,
+};
+
+describe('ContactForm', () => {
+ it('renders a contact form', () => {
+ render(<ContactForm {...props} />);
+ expect(
+ screen.getByRole('form', { name: 'Contact form' })
+ ).toBeInTheDocument();
+ });
+
+ it('renders a name field', () => {
+ render(<ContactForm {...props} />);
+ expect(screen.getByRole('textbox', { name: /^Name:/ })).toBeInTheDocument();
+ });
+
+ it('renders an email field', () => {
+ render(<ContactForm {...props} />);
+ expect(
+ screen.getByRole('textbox', { name: /^Email:/ })
+ ).toBeInTheDocument();
+ });
+
+ it('renders an object field', () => {
+ render(<ContactForm {...props} />);
+ expect(
+ screen.getByRole('textbox', { name: /^Object:/ })
+ ).toBeInTheDocument();
+ });
+
+ it('renders a message field', () => {
+ render(<ContactForm {...props} />);
+ expect(
+ screen.getByRole('textbox', { name: /^Message:/ })
+ ).toBeInTheDocument();
+ });
+
+ it('renders a submit button', () => {
+ render(<ContactForm {...props} />);
+ expect(screen.getByRole('button', { name: /^Send/ })).toBeInTheDocument();
+ });
+});