For UI automation, I am trying to add unique id for React component. before adding the ID, my test cases are [passing for finding child component. but after adding id with:
<Fragment>
<UIDConsumer>
{ (id => <div id={id} >
<CustomComponent/>
</div>})
</Fragment>
in my jest Unit test, is failing
wrapper = mount(
<Provider>
<ViewComponent/>
</Provider>
);
it("CustomComponent component", () => {
const CustomComponent = wrapper.find(CustomComponent);
expect(CustomComponent).to.have.lengthOf(1);
});