Skip to content

Commit fb5bb40

Browse files
authored
Apply suggestions from code review
1 parent 1684aff commit fb5bb40

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

docs/site/docs/providing-input/passing-parameters-to-components.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -448,15 +448,15 @@ It is possible to nest a component under tests inside other components, if that
448448
449449
[!code-csharp[](../../../samples/tests/xunit/NestedComponentTest.cs#L16-L28)]
450450
451-
These examples do the same thing, i.e. render the `<HelloWorld>` component inside the `<Wrapper>` component. What is special in both cases is the use of the `FindComponent<HelloWorld>()`, which returns a `IRenderedComponent<HelloWorld>`, which gives access to only the `<HelloWorld>` components part of the render tree, and the `<HelloWorld>` components instance.[__AP: The last clause is rather ambiguous. Is it that the IRenderedComponent\<HelloWorld\> gives access to two things - the \<HelloWorld\> components part of the render tree and the \<HelloWorld\> components instance - or that something (\<Wrapper\>?) returns (1) the IRenderedComponent\<HelloWorld\> and (2) the \<HelloWorld\> components instance?__]
451+
These examples do the same thing, i.e. render the `<HelloWorld>` component inside the `<Wrapper>` component. What is special in both cases is the use of the `FindComponent<HelloWorld>()` that returns a `IRenderedComponent<HelloWorld>`. This is needed because the `RenderComponent<Wrapper>` method call returns an `IRenderedComponent<Wrapper>` instance, that provides access to the instance of the `<Wrapper>` component, but not the `<HelloWorld>`-component instance.
452452
453453
# [Razor test code](#tab/razor)
454454
455455
[!code-cshtml[](../../../samples/tests/razor/NestedComponentTest.razor#L3-)]
456456
457457
This is just regular Blazor child content parameter passing, where one component is rendered inside another, i.e. the `<HelloWorld>` component inside the `<Wrapper>` component.
458458
459-
The special thing in this case is that the `GetComponentUnderTest<HelloWorld>()` method specifies the `<HelloWorld>` component as its target instead of the outer `<Wrapper>` component. This returns a `IRenderedComponent<HelloWorld>`, which gives access to only the `<HelloWorld>` components part of the render tree, and the `<HelloWorld>` components instance. [__AP: The last clause is rather ambiguous. Is it that the IRenderedComponent\<HelloWorld\> gives access to two things - the \<HelloWorld\> components part of the render tree and the \<HelloWorld\> components instance - or that something (\<Wrapper\>?) returns (1) the IRenderedComponent\<HelloWorld\> and (2) the \<HelloWorld\> components instance?__]
459+
The special thing in this case is that the `GetComponentUnderTest<HelloWorld>()` method specifies the `<HelloWorld>` component as its target instead of the outer `<Wrapper>` component. This returns a `IRenderedComponent<HelloWorld>`, the child of the `<Wrapper>` component, making it the component under test.
460460
461461
***
462462

0 commit comments

Comments
 (0)