Open sschafercdd opened 1 year ago
This is probably really just an enyzme thing - I don't know.
I've had some success with the following monkeypatch:
import { ReactWrapper } from 'enzyme';
ReactWrapper.prototype._find = ReactWrapper.prototype.find;
ReactWrapper.prototype.find = function (selector) {
if (typeof selector === 'string') {
return this._find(selector).hostNodes();
}
return this._find(selector);
};
First of all, thanks for making this. I hope I can make it work in our project.
We have some code like this:
In the current React 16 codebase, inputs.length is 1. In the 18 codebase with this adapter, length is 2, although I've verified that component.html() just has one element with the
assayAnnotationInput-input
classname.component.find('.assayAnnotationInput-input').get(1).type
returns 'input', butcomponent.find('.assayAnnotationInput-input').get(0).type
returns an object containing$$typeof: Symbol(react.forward_ref)
Any ideas?