testcafe-react-selectors icon indicating copy to clipboard operation
testcafe-react-selectors copied to clipboard

Should look for nodes with alternate component version when looking for chidren

Open mvoica opened this issue 5 years ago • 1 comments

https://github.com/DevExpress/testcafe-react-selectors/blob/9e43d4bed4d77e7cd68292c66dedc5d4db960e63/src/react-16/index.js#L125

could this line be something like

var renderedChildren = getRenderedChildren(getRenderedComponentVersion(reactComponent, getRootElsReact16()));

?

or well, could the children be looked at in the context of the component.alternate (?)

The getRenderedComponentVersion is already called when we look for the component corresponding to a certain dom node (which is where the search for children starts):

https://github.com/DevExpress/testcafe-react-selectors/blob/9e43d4bed4d77e7cd68292c66dedc5d4db960e63/src/react-16/react-utils.js#L106

but we never look at the component.alternate during the search for nested children

Came across this when trying to access the children of a component that is wrapped by the [email protected] translate(Component) wrapper, when doing some .findReact(A).findReact(B).findReact(C). In which case, one of the intermediate components has no child, but its alternate does have the child with which the search should continue.

mvoica avatar Aug 07 '19 12:08 mvoica

Currently your scenario looks unclear to us. Could you please provide a sample project with a test that can help us reproduce this behavior?

Dmitry-Ostashev avatar Aug 08 '19 08:08 Dmitry-Ostashev