I have a situation where I want to check if particular element rendered inside particular div in my component:
import { render, within } from '@testing-library/react';
it('', async () => {
const { findByTestId } = render(...);
const wrapper = findByTestId('wrapper');
const nestedDiv = within(wrapper).findByText('abc');
// ^^^^^ error - value must be HTMLElement not object
});
Looking for help how to do it thanks