-
Notifications
You must be signed in to change notification settings - Fork 110
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
:sparkles
yarn rw g component CommentForm
- Loading branch information
1 parent
a13f566
commit 7214f2a
Showing
3 changed files
with
49 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// When you've added props to your component, | ||
// pass Storybook's `args` through this story to control it from the addons panel: | ||
// | ||
// ```tsx | ||
// import type { ComponentStory } from '@storybook/react' | ||
// | ||
// export const generated: ComponentStory<typeof CommentForm> = (args) => { | ||
// return <CommentForm {...args} /> | ||
// } | ||
// ``` | ||
// | ||
// See https://storybook.js.org/docs/react/writing-stories/args. | ||
|
||
import type { ComponentMeta } from '@storybook/react' | ||
|
||
import CommentForm from './CommentForm' | ||
|
||
export const generated = () => { | ||
return <CommentForm /> | ||
} | ||
|
||
export default { | ||
title: 'Components/CommentForm', | ||
component: CommentForm, | ||
} as ComponentMeta<typeof CommentForm> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { render } from '@redwoodjs/testing/web' | ||
|
||
import CommentForm from './CommentForm' | ||
|
||
// Improve this test with help from the Redwood Testing Doc: | ||
// https://redwoodjs.com/docs/testing#testing-components | ||
|
||
describe('CommentForm', () => { | ||
it('renders successfully', () => { | ||
expect(() => { | ||
render(<CommentForm />) | ||
}).not.toThrow() | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
const CommentForm = () => { | ||
return ( | ||
<div> | ||
<h2>{'CommentForm'}</h2> | ||
<p>{'Find me in ./web/src/components/CommentForm/CommentForm.tsx'}</p> | ||
</div> | ||
) | ||
} | ||
|
||
export default CommentForm |