Hello, I think this is a bug but I'm not sure because I'm not an expert on your great lib !
Everything you need is in codesandbox reproduction.
Error on test expect(wrapper.find(CloseIcon)).toBeInTheDocument();
But with classic expect(wrapper.find(CloseIcon)).toHaveLength(1); it works... This is why I think it's a bug.
https://codesandbox.io/s/morning-river-ymv5b?file=/src/App.test.js
received value must be an HTMLElement or an SVGElement.
Received has type: object
Received has value: {}
Enzyme does not return actual DOM elements but custom objects. This library does not support wrappers from enzyme.
Note that this is designed to work with React Testing Library which uses actual DOM elements. If you want to keep Enzyme, you may want to use Enzyme-specific matchers or get the DOM elements from Enzyme before using them with jest-dom.
Most helpful comment
Enzyme does not return actual DOM elements but custom objects. This library does not support wrappers from enzyme.