testing-library / testing-library/user-event
Verbose Mode
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 2.3k
- Forks
- 258
- PR merge metrics
- No merged PRs in 30d
Description
(Continued from https://github.com/testing-library/user-event/issues/616#issuecomment-1224204191)
Sometimes it's really difficult to know why an event isn't working as expected, for example when clicking on the submit button of an invalid form, the form isn't submitted. Currently, you have to know all the things to check for a particular userEvent.*().
Obviously, you don't want an exception in that case either because you might be trying to test the form validation itself.
When debugging these kinds of issues, it would be kind of helpful to have some kind of "Verbose Mode":
Hovering over the element
Clicking the element
Firing "onClick"
Firing "onSubmit" on the element's form
Warning: Could not submit form because it is invalid
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 with the existing userEvent.* implementations and the linked discussion in testing-library/user-event#616. Define how an opt-in verbose mode should report actions and non-exception warnings, using the invalid-form submission example as the acceptance target.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- testing
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100