Generic wrapper around testable component for required dependencies #1421
-
I'm testing a MudBlazor component that spawns another element using a @* PopoverProviderWrapper *@
<MudPopoverProvider />
@ChildContent
@code {
[Parameter]
public RenderFragment ChildContent { get; set; }
} var child = RenderComponent<MyChildComponent>(p =>
p.Add(x => x.Xyz, xyz)
);
var cut = RenderComponent<PopoverProviderWrapper>(p =>
p.AddChildContent(child)
); Is this the canonical way of doing it? I need the child to be an IRenderedComponent to do the actual testing, how do I make that work? Thank you! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 8 replies
-
Hey @danielchalmers you might want to checkout the following discussion we had earlier: #663 (reply in thread) Does that fit your needs? |
Beta Was this translation helpful? Give feedback.
Hey @danielchalmers
you might want to checkout the following discussion we had earlier: #663 (reply in thread)
Does that fit your needs?