-
-
Notifications
You must be signed in to change notification settings - Fork 115
Closed
Description
The goal is to make shallow rendering possible, with as few caveats as possible.
It should:
- Mimic shallow rendering principles from other component testing frameworks, e.g. React
- Replace all child components of the component under test with stub components
- Not replace components added to
TestContext.RenderTree - Stub components should be represented in the DOM tree as the component they have replaced, with correct casing.
- Shallow rendering does not replace
CascadingValue<T>which are part of the render fragment being rendered. - Enable stub/shallow options to be passed to shallow render methods to control how removed components are replaced.
Limitations:
ShallowRenderwill only render the first top level component. Other components, including its children will be stubbed.- Once a test context has been used to perform a shallow render, its
Render,ShallowRender, andRenderComponentmethods will all throw an exception, with the message The test context has previously been used to perform a shallow render of a component or render fragment. Rendering another component or render fragment with the same test context is not currently supported, since it can result in unpredictable results.. This limitation might be removed in the future, but right now I do not see a neat way to achieve this.
Replaces #17.
Metadata
Metadata
Assignees
Labels
No labels