From 88b575b0d81e97531b70e90c1e124719b547614b Mon Sep 17 00:00:00 2001
From: Armand Philippot <git@armandphilippot.com>
Date: Thu, 14 Apr 2022 22:14:35 +0200
Subject: chore: add a Search component

---
 src/components/organisms/toolbar/search.test.tsx | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
 create mode 100644 src/components/organisms/toolbar/search.test.tsx

(limited to 'src/components/organisms/toolbar/search.test.tsx')

diff --git a/src/components/organisms/toolbar/search.test.tsx b/src/components/organisms/toolbar/search.test.tsx
new file mode 100644
index 0000000..0ce09d8
--- /dev/null
+++ b/src/components/organisms/toolbar/search.test.tsx
@@ -0,0 +1,19 @@
+import { render, screen } from '@test-utils';
+import Search from './search';
+
+describe('Search', () => {
+  it('renders a button to open search modal', () => {
+    render(<Search isActive={false} setIsActive={() => null} />);
+    expect(screen.getByRole('checkbox')).toHaveAccessibleName('Open search');
+  });
+
+  it('renders a button to close search modal', () => {
+    render(<Search isActive={true} setIsActive={() => null} />);
+    expect(screen.getByRole('checkbox')).toHaveAccessibleName('Close search');
+  });
+
+  it('renders a search form', () => {
+    render(<Search isActive={true} setIsActive={() => null} />);
+    expect(screen.getByRole('searchbox')).toBeInTheDocument();
+  });
+});
-- 
cgit v1.2.3

