Wrapped test nodes not accessible if within functional children
jellison opened this issue · 1 comments
Bug
In the documentation, wrapped test nodes are direct children in the assertion:
const baseTemplate = assertion(() =>
<div>
<WrappedTestNode />
</div>
);
If the wrapped test node is not a direct child - but instead used within a functional child - the node is not accessible via the Assertion API for modification.
For example, consider this WrappedTestNode
that is a functional child of SomeOtherWidget
:
const baseTemplate = assertion(() =>
<div>
<SomeOtherWidget>
{
content: () => <WrappedTestNode />
}
</SomeOtherWidget>
</div>
);
Fixed assertions will function as expected, but any assertions that modify the WrappedTestNode
- such as baseAssertion.setChildren(WrappedTestNode, () => 'blah')
- will fail with the following message: Error: Unable to find node
.
Expected
Functional children of widgets within an assertion template are executed in such a way that they are accessible via the Assertion API.
My fix for this only fixed the case where the function is a property on an object. Reopening since this is still broken for a functional child passed directly