From 11696faa3177023face73fa077c93d0253ea53c6 Mon Sep 17 00:00:00 2001 From: Martin Costello Date: Tue, 3 Sep 2024 20:49:56 +0100 Subject: [PATCH 1/2] docs: Fix heading (#1537) * Fix heading Fix heading not rendering correctly. * Fix heading Be gone, crazy space. --- .../docs/providing-input/passing-parameters-to-components.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/site/docs/providing-input/passing-parameters-to-components.md b/docs/site/docs/providing-input/passing-parameters-to-components.md index 4db2fccf1..a69b91875 100644 --- a/docs/site/docs/providing-input/passing-parameters-to-components.md +++ b/docs/site/docs/providing-input/passing-parameters-to-components.md @@ -466,7 +466,8 @@ When rendering a `RenderFragment` using the 's `Add` method, if a component parameter is only annotated with the `[SupplyParameterFromQuery]` attribute. Instead, pass a query string parameters by setting it using the . From f8674d7f7d8c84026d025c51d30d31d2a1d8517d Mon Sep 17 00:00:00 2001 From: Steven Giesel Date: Wed, 4 Sep 2024 09:30:37 +0200 Subject: [PATCH 2/2] docs: Fix AddFakePersistentComponentState examples (Fixes #1539) (#1540) --- .../test-doubles/faking-persistentcomponentstate.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/site/docs/test-doubles/faking-persistentcomponentstate.md b/docs/site/docs/test-doubles/faking-persistentcomponentstate.md index c03f78110..9e28aa42c 100644 --- a/docs/site/docs/test-doubles/faking-persistentcomponentstate.md +++ b/docs/site/docs/test-doubles/faking-persistentcomponentstate.md @@ -12,7 +12,7 @@ bUnit comes with fake version of the `PersistentComponentState` type in Blazor t To use the fake `PersistentComponentState` in bUnit, call the `AddFakePersistentComponentState` extension method on `TestContext`: ```csharp -var fakeState = AddFakePersistentComponentState(); +var fakeState = this.AddFakePersistentComponentState(); ``` Calling `AddFakePersistentComponentState` returns a `FakePersistentComponentState` type, which has three methods; one to persist data, one to get persisted data, and one that triggers any "OnPersisting" callbacks added to the `PersistentComponentState`. @@ -20,7 +20,7 @@ Calling `AddFakePersistentComponentState` returns a `FakePersistentComponentStat To add data to the `PersistentComponentState` before running a test, i.e. to verify that a component uses the persisted state, use the `Persist` method: ```csharp -var fakeState = AddFakePersistentComponentState(); +var fakeState = this.AddFakePersistentComponentState(); var key = "STATE KEY"; var data = ...; // data to persist @@ -31,7 +31,7 @@ fakeState.Persist(key, data); To trigger a callback registered with the `PersistentComponentState.RegisterOnPersisting` method, use the `TriggerOnPersisting` method on `FakePersistentComponentState`: ```csharp -var fakeState = AddFakePersistentComponentState(); +var fakeState = this.AddFakePersistentComponentState(); // render component @@ -41,7 +41,7 @@ fakeState.TriggerOnPersisting(); To check if data has been persisted, use the `TryTake` method: ```csharp -var fakeState = AddFakePersistentComponentState(); +var fakeState = this.AddFakePersistentComponentState(); var key = "STATE KEY"; // render component, call TriggerOnPersisting @@ -95,7 +95,7 @@ To test that the `` component uses persisted weather data instead of ```csharp // Arrange -var fakeState = AddFakePersistentComponentState(); +var fakeState = this.AddFakePersistentComponentState(); // Persist a single weather forecast with a temperature of 42 fakeState.Persist("weather-data", new [] { new WeatherForecast { Temperature = 42 } }); @@ -111,7 +111,7 @@ To test that the `` component correctly persists weather data when it ```csharp // Arrange -var fakeState = AddFakePersistentComponentState(); +var fakeState = this.AddFakePersistentComponentState(); var cut = RenderComponent(); // Act - trigger the FetchData components PersistForecasts method