-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Description
@testing-library/react
version:11.2.5
- Testing Framework and version: JEST:
27.0.3
- DOM Environment:
- "@testing-library/jest-dom":
^5.16.1
,
Relevant code or config:
describe('html input field', () => {
it('should be required', () => {
const { baseElement } = render(<input name="my-input" required />);
expect(baseElement).toMatchInlineSnapshot(`
<body>
<div>
<input
name="my-input"
required=""
/>
</div>
</body>
`);
});
});
Problem description:
The inline snapshot of an html input with a required attribute is not what is expected.
Just wanted to put this out there incase this isn't a known issue. Could be related to:
- form submitted despite required input jsdom/jsdom#2898
- Required radio input submitted even when not selected #607
- Submit event handler fires even if form is invalid #729
Feel free to close if there's a good reason to do so. Thank you!
Metadata
Metadata
Assignees
Labels
No labels