dojo / framework

Dojo Framework. A Progressive Framework for Modern Web Apps
https://dojo.io/
Other
586 stars 79 forks source link

Unable to test deeply nested children when using typed children #897

Closed agubler closed 3 years ago

agubler commented 3 years ago

Bug

At the moment the test renderer is limited to enable testing object children to a single level which means that anything with more complex nesting it's not possible to resolve the children if they are functions.

Additionally just having nested children causes an error when formatting the widget and expected assertion result during the renderer.expect.

The current mechanism for resolving children passes params needed uses the renderer.child API, requiring a wrapped widget and the key of the child object.

renderer.child(WrappedWidget, 'label', 'params', 'for', 'child');

This is limited to a single level of children, it would be good if there was a way to resolve nested functional children by providing the params in a similar way to the existing API.

renderer.child(WrappedWidget, () => {
    return {
        labels: {
            leading: ['params', 'for', 'child']
        }
    }
});