From 0e52a59917406ad03c174e030c6c1c92ab23449d Mon Sep 17 00:00:00 2001
From: Armand Philippot <git@armandphilippot.com>
Date: Mon, 30 Oct 2023 12:44:11 +0100
Subject: refactor(components): extract SettingsForm component form
 SettingsModal

We could use an array of items and map over it instead of repeating the
Switch component for each settings but with translations, it becomes
quickly unreadable. So I prefer to keep separate components.
---
 .../organisms/forms/settings-form/settings-form.test.tsx  | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
 create mode 100644 src/components/organisms/forms/settings-form/settings-form.test.tsx

(limited to 'src/components/organisms/forms/settings-form/settings-form.test.tsx')

diff --git a/src/components/organisms/forms/settings-form/settings-form.test.tsx b/src/components/organisms/forms/settings-form/settings-form.test.tsx
new file mode 100644
index 0000000..7029595
--- /dev/null
+++ b/src/components/organisms/forms/settings-form/settings-form.test.tsx
@@ -0,0 +1,15 @@
+import { describe, expect, it } from '@jest/globals';
+import { render, screen as rtlScreen } from '../../../../../tests/utils';
+import { SettingsForm } from './settings-form';
+
+describe('SettingsForm', () => {
+  it('renders a form with four settings', () => {
+    const label = 'voluptatem maiores rerum';
+    const settingsNumber = 4;
+
+    render(<SettingsForm aria-label={label} />);
+
+    expect(rtlScreen.getByRole('form', { name: label })).toBeInTheDocument();
+    expect(rtlScreen.getAllByRole('radiogroup')).toHaveLength(settingsNumber);
+  });
+});
-- 
cgit v1.2.3

