When unit testing react components I often check for the existence of a child node based on the presence or content of a prop.
With enzyme, I find the element using .find
on either the shallow or mount wrapper and then check if the length of that is 1. With chai, this would look like this:
const wrapper = shallow(<MYReactComponent/>);
const innerNode = wrapper.find('some-css-selector');
expect(innerNode.length).to.equal(1);
Is there a better way of checking