From ce4a18899f24ba89b63ef743476ec0dbf1999ecf Mon Sep 17 00:00:00 2001
From: Armand Philippot <git@armandphilippot.com>
Date: Fri, 3 Nov 2023 23:03:06 +0100
Subject: refactor(components): rewrite SearchForm component

* remove searchPage prop (the consumer should handle the submit)
* change onSubmit type
* use `useForm` hook to handle the form
---
 src/components/organisms/layout/no-results.test.tsx | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

(limited to 'src/components/organisms/layout/no-results.test.tsx')

diff --git a/src/components/organisms/layout/no-results.test.tsx b/src/components/organisms/layout/no-results.test.tsx
index 85f60cf..fdd86f7 100644
--- a/src/components/organisms/layout/no-results.test.tsx
+++ b/src/components/organisms/layout/no-results.test.tsx
@@ -1,15 +1,12 @@
 import { describe, expect, it } from '@jest/globals';
-import { render, screen } from '../../../../tests/utils';
+import { render, screen as rtlScreen } from '../../../../tests/utils';
 import { NoResults } from './no-results';
 
 describe('NoResults', () => {
-  it('renders a no results text', () => {
-    render(<NoResults searchPage="#" />);
-    expect(screen.getByText(/No results/i)).toBeInTheDocument();
-  });
+  it('renders a text with a form', () => {
+    render(<NoResults />);
 
-  it('renders a search form', () => {
-    render(<NoResults searchPage="#" />);
-    expect(screen.getByRole('searchbox')).toBeInTheDocument();
+    expect(rtlScreen.getByText(/No results/i)).toBeInTheDocument();
+    expect(rtlScreen.getByRole('searchbox')).toBeInTheDocument();
   });
 });
-- 
cgit v1.2.3

