Answers for "react testing library getBy image"

0

react testing library getBy image

it('uses correct src', async () => {
    const { getByAltText } = await render(<MyComponent />);

    const image = getByAltText('the_alt_text');

    expect(image.src).toContain('the_url');
});
Posted by: Guest on May-29-2021

Code answers related to "react testing library getBy image"

Code answers related to "Javascript"

Browse Popular Code Answers by Language