Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrapped test nodes not accessible if within functional children #775

Closed
jellison opened this issue May 12, 2020 · 1 comment · Fixed by #780 or #851
Closed

Wrapped test nodes not accessible if within functional children #775

jellison opened this issue May 12, 2020 · 1 comment · Fixed by #780 or #851
Assignees

Comments

@jellison
Copy link

jellison commented May 12, 2020

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.

@maier49
Copy link
Contributor

maier49 commented Oct 9, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants