Skip to content

Commit

Permalink
SQUASH ME
Browse files Browse the repository at this point in the history
  • Loading branch information
linkdotnet authored Dec 13, 2024
1 parent 5ecffc5 commit 14cdc53
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/site/docs/interaction/render-modes.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
uid: render-modes
title: Support for render modes and renderer info
title: Support for render modes and renderer info
---

# Support for render modes and the renderer info
# Support for render modes and `RendererInfo`
Render modes in Blazor Web Apps determine the hosting model and interactivity of components. The render mode for example can be applied to a component using the `@rendermode` directive. The [`RendererInfo`](https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.components.rendererinfo?view=aspnetcore-9.0) allows the application to determine the interactivity and location of the component. For more details, check out the [Blazor render modes](https://learn.microsoft.com/en-us/aspnet/core/blazor/components/render-modes?view=aspnetcore-9.0) documentation.

## Setting the render mode for a component under test
Expand Down
7 changes: 7 additions & 0 deletions src/bunit.web/TestContextWrapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,13 @@ public virtual IRenderedFragment Render(RenderFragment renderFragment)
/// </summary>
public virtual void DisposeComponents() => TestContext?.DisposeComponents();

#if NET9_0_OR_GREATER
/// <summary>
/// Sets the <see cref="RendererInfo"/> for the renderer.
/// </summary>
public virtual void SetRendererInfo(RendererInfo? rendererInfo) => TestContext?.SetRendererInfo(rendererInfo);
#endif

/// <summary>
/// Dummy method required to allow Blazor's compiler to generate
/// C# from .razor files.
Expand Down

0 comments on commit 14cdc53

Please sign in to comment.