aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/organisms/forms/search-form
diff options
context:
space:
mode:
authorArmand Philippot <git@armandphilippot.com>2023-10-05 18:58:30 +0200
committerArmand Philippot <git@armandphilippot.com>2023-11-11 18:14:41 +0100
commitfb860884857da73ee5b5e897745301cdf1d770a2 (patch)
tree3aaf3c192b3375a7e1bf2dbf9daa866be357a2f5 /src/components/organisms/forms/search-form
parente97325a2c174a87c29593d1b42b9a1cc1eaf11af (diff)
refactor(components): make form components compliant with Eslint rules
Diffstat (limited to 'src/components/organisms/forms/search-form')
-rw-r--r--src/components/organisms/forms/search-form/search-form.module.scss3
-rw-r--r--src/components/organisms/forms/search-form/search-form.stories.tsx2
-rw-r--r--src/components/organisms/forms/search-form/search-form.test.tsx8
3 files changed, 9 insertions, 4 deletions
diff --git a/src/components/organisms/forms/search-form/search-form.module.scss b/src/components/organisms/forms/search-form/search-form.module.scss
index e485380..1315fde 100644
--- a/src/components/organisms/forms/search-form/search-form.module.scss
+++ b/src/components/organisms/forms/search-form/search-form.module.scss
@@ -49,6 +49,9 @@
}
.field {
+ min-width: 0;
+ width: 100%;
+
&:focus-within ~ .btn {
background: var(--color-bg);
border-color: var(--color-primary);
diff --git a/src/components/organisms/forms/search-form/search-form.stories.tsx b/src/components/organisms/forms/search-form/search-form.stories.tsx
index c5fbeb9..971a8ee 100644
--- a/src/components/organisms/forms/search-form/search-form.stories.tsx
+++ b/src/components/organisms/forms/search-form/search-form.stories.tsx
@@ -1,4 +1,4 @@
-import { ComponentMeta, ComponentStory } from '@storybook/react';
+import type { ComponentMeta, ComponentStory } from '@storybook/react';
import { SearchForm } from './search-form';
/**
diff --git a/src/components/organisms/forms/search-form/search-form.test.tsx b/src/components/organisms/forms/search-form/search-form.test.tsx
index 1af0a47..908a8eb 100644
--- a/src/components/organisms/forms/search-form/search-form.test.tsx
+++ b/src/components/organisms/forms/search-form/search-form.test.tsx
@@ -1,17 +1,19 @@
import { describe, expect, it } from '@jest/globals';
-import { render, screen } from '../../../../../tests/utils';
+import { render, screen as rtlScreen } from '../../../../../tests/utils';
import { SearchForm } from './search-form';
describe('SearchForm', () => {
it('renders a search input', () => {
render(<SearchForm searchPage="#" />);
expect(
- screen.getByRole('searchbox', { name: 'Search for:' })
+ rtlScreen.getByRole('searchbox', { name: 'Search for:' })
).toBeInTheDocument();
});
it('renders a submit button', () => {
render(<SearchForm searchPage="#" />);
- expect(screen.getByRole('button', { name: 'Search' })).toBeInTheDocument();
+ expect(
+ rtlScreen.getByRole('button', { name: 'Search' })
+ ).toBeInTheDocument();
});
});