From 2b70c89962a18f33995fcca762fed73fd5ce8f28 Mon Sep 17 00:00:00 2001
From: Armand Philippot <git@armandphilippot.com>
Date: Fri, 1 Apr 2022 22:46:07 +0200
Subject: chore: add labelled field component

---
 .../molecules/forms/labelled-field.test.tsx           | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
 create mode 100644 src/components/molecules/forms/labelled-field.test.tsx

(limited to 'src/components/molecules/forms/labelled-field.test.tsx')

diff --git a/src/components/molecules/forms/labelled-field.test.tsx b/src/components/molecules/forms/labelled-field.test.tsx
new file mode 100644
index 0000000..6fabe19
--- /dev/null
+++ b/src/components/molecules/forms/labelled-field.test.tsx
@@ -0,0 +1,19 @@
+import { render, screen } from '@test-utils';
+import LabelledField from './labelled-field';
+
+describe('LabelledField', () => {
+  it('renders a labelled field', () => {
+    render(
+      <LabelledField
+        type="text"
+        id="jest-text-field"
+        name="jest-text-field"
+        label="Jest text field"
+        value="test"
+        setValue={() => null}
+      />
+    );
+    expect(screen.getByLabelText('Jest text field')).toBeInTheDocument();
+    expect(screen.getByRole('textbox')).toHaveValue('test');
+  });
+});
-- 
cgit v1.2.3

