I am trying to get the alt text for an img in my tests. It is not found. The getByAltText only works for the tag img. It seems that it does not work for ion-img.
Is there any way to make it work?
test(`should have an alt for img with text as 'Collections not found'`, () => {
const { getByAltText } = render(<CollectionNotFound />);
getByAltText("Collections not found");
});
Error:
Unable to find an element with the alt text: Collections not found.
<ion-img
alt="Collections not found"
class="sc-bdfBwQ ckSWCD"
src="notfound.svg"
/>