Skip to content

Commit

Permalink
:sparkles yarn rw g component CommentForm
Browse files Browse the repository at this point in the history
  • Loading branch information
tktcorporation committed Oct 10, 2022
1 parent a13f566 commit 7214f2a
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 0 deletions.
25 changes: 25 additions & 0 deletions web/src/components/CommentForm/CommentForm.stories.tsx
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>
14 changes: 14 additions & 0 deletions web/src/components/CommentForm/CommentForm.test.tsx
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()
})
})
10 changes: 10 additions & 0 deletions web/src/components/CommentForm/CommentForm.tsx
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

0 comments on commit 7214f2a

Please sign in to comment.