In my render method I have
<span onClick={handleDelete} className="delete-action">
<FontAwesomeIcon icon="trash-alt" />
</span>
Using react-testing-library how can I access the above span element. This is what I tried so far
getByText(<FontAwesomeIcon icon="trash-alt" />)
but the error says matcher.test is not a function. How should I approach this.