-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: create more tests and add documentation for check group component
Adds some extra tests for the check group input component, making sure some extra conditions are covered. Primarily testing submitting a for with a check input when it has a default value, and making sure that the form does not submit when the validation for the check input attribute does not pass. Also added some documentation for this component, creating a page and providing an example. Ref: #37
- Loading branch information
1 parent
0d2a82a
commit cb1c4e0
Showing
3 changed files
with
91 additions
and
1 deletion.
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
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 @@ | ||
import Layout from "../layouts/main"; | ||
|
||
export const meta = { | ||
title: "Components | Check Group", | ||
}; | ||
|
||
# Check Group | ||
|
||
This input has a customized API to handle a checkbox input type. | ||
|
||
```jsx | ||
import { CheckGroup } from "@adeattwood/react-form"; | ||
|
||
<CheckGroup attribute="checkMe"> | ||
{({ props, error }) => ( | ||
<div> | ||
<label htmlFor={props.id}>Check</label> | ||
<input {...props} /> | ||
{error && <p>{error}</p>} | ||
</div> | ||
)} | ||
</CheckGroup> | ||
``` | ||
|
||
export default ({ children }) => <Layout meta={meta}>{children}</Layout>; |
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
cb1c4e0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
react-form – ./
react-form-adeattwood.vercel.app
react-form-git-0x-adeattwood.vercel.app
react-form-sandy.vercel.app