`alt` attribute can't be empty
Tasiobg opened this issue · comments
tasio commented
Since this update #1241 the alt
attribute for the img
role can't be empty.
My understanding is that the alt
attribute should be present but in some cases like decorative images it should be empty, some info here
Is this an issue or an intended change?
Works
it(`testcase`, async () => {
render(
<div>
<img src="url" alt="alt text" />
</div>,
);
expect(screen.getByRole('img')).toBeInTheDocument();
});
Fail
it(`testcase`, async () => {
render(
<div>
<img src="url" alt="" />
</div>,
);
expect(screen.getByRole('img')).toBeInTheDocument();
});
Matan Borenkraout commented