marmelab / marmelab/react-admin
required() doesn't mark an input required
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 26.9k
- Forks
- 5.5k
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 19
Description
**Is your feature request related to a problem? Please describe.**
Testing if an input is correctly required with react-testing-library fails:
```
const id = within(edit).getByLabelText("Id *");
expect(id).toBeRequired();
```
**Describe the solution you'd like**
In addition to adding the `*` to the label, I'd expect the required attribute to be set.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the React input component that adds the `*` to labels, then run the react-testing-library example using `within(edit).getByLabelText("Id *")` and `toBeRequired()`. Done means the rendered input has the required attribute as well as the existing required marker in its label.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react
- Domain
- accessibility, frontend, testing
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100