aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/organisms/forms/comment-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/comment-form
parente97325a2c174a87c29593d1b42b9a1cc1eaf11af (diff)
refactor(components): make form components compliant with Eslint rules
Diffstat (limited to 'src/components/organisms/forms/comment-form')
-rw-r--r--src/components/organisms/forms/comment-form/comment-form.stories.tsx16
-rw-r--r--src/components/organisms/forms/comment-form/comment-form.test.tsx6
2 files changed, 11 insertions, 11 deletions
diff --git a/src/components/organisms/forms/comment-form/comment-form.stories.tsx b/src/components/organisms/forms/comment-form/comment-form.stories.tsx
index a6069e6..a521bf7 100644
--- a/src/components/organisms/forms/comment-form/comment-form.stories.tsx
+++ b/src/components/organisms/forms/comment-form/comment-form.stories.tsx
@@ -1,5 +1,5 @@
-import { ComponentMeta, ComponentStory } from '@storybook/react';
-import { CommentForm } from './comment-form';
+import type { ComponentMeta, ComponentStory } from '@storybook/react';
+import { CommentForm as CommentFormComponent } from './comment-form';
const saveComment = async () => {
/** Do nothing. */
@@ -10,7 +10,7 @@ const saveComment = async () => {
*/
export default {
title: 'Organisms/Forms',
- component: CommentForm,
+ component: CommentFormComponent,
args: {
saveComment,
titleAlignment: 'left',
@@ -111,13 +111,13 @@ export default {
},
},
},
-} as ComponentMeta<typeof CommentForm>;
+} as ComponentMeta<typeof CommentFormComponent>;
-const Template: ComponentStory<typeof CommentForm> = (args) => (
- <CommentForm {...args} />
+const Template: ComponentStory<typeof CommentFormComponent> = (args) => (
+ <CommentFormComponent {...args} />
);
/**
- * Forms Stories - Comment
+ * Forms Stories - Comment form
*/
-export const Comment = Template.bind({});
+export const CommentForm = Template.bind({});
diff --git a/src/components/organisms/forms/comment-form/comment-form.test.tsx b/src/components/organisms/forms/comment-form/comment-form.test.tsx
index ca02edc..88a7de9 100644
--- a/src/components/organisms/forms/comment-form/comment-form.test.tsx
+++ b/src/components/organisms/forms/comment-form/comment-form.test.tsx
@@ -1,5 +1,5 @@
import { describe, expect, it } from '@jest/globals';
-import { render, screen } from '../../../../../tests/utils';
+import { render, screen as rtlScreen } from '../../../../../tests/utils';
import { CommentForm } from './comment-form';
const saveComment = async () => {
@@ -10,7 +10,7 @@ const title = 'Cum voluptas voluptatibus';
describe('CommentForm', () => {
it('renders a form', () => {
render(<CommentForm saveComment={saveComment} />);
- expect(screen.getByRole('form')).toBeInTheDocument();
+ expect(rtlScreen.getByRole('form')).toBeInTheDocument();
});
it('renders an optional title', () => {
@@ -18,7 +18,7 @@ describe('CommentForm', () => {
<CommentForm saveComment={saveComment} title={title} titleLevel={2} />
);
expect(
- screen.getByRole('heading', { level: 2, name: title })
+ rtlScreen.getByRole('heading', { level: 2, name: title })
).toBeInTheDocument();
});
});