Skip to content

Commit 5ebaaac

Browse files
committed
Fix typo + test old way of workign as well.
1 parent 2e5f7dc commit 5ebaaac

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

src/Components/Endpoints/src/DependencyInjection/HttpNavigationManager.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ namespace Microsoft.AspNetCore.Components.Endpoints;
77

88
internal sealed class HttpNavigationManager : NavigationManager, IHostEnvironmentNavigationManager
99
{
10-
private const string EnableThrowNavigatioExceptionSwitchKey = "Microsoft.AspNetCore.Components.Endpoints.EnableThrowNavigatioException";
11-
private static readonly bool _throwNavigationException = AppContext.TryGetSwitch(EnableThrowNavigatioExceptionSwitchKey, out var switchValue) && switchValue;
10+
private const string EnableThrowNavigationException = "Microsoft.AspNetCore.Components.Endpoints.EnableThrowNavigationException";
11+
private static readonly bool _throwNavigationException = AppContext.TryGetSwitch(EnableThrowNavigationException, out var switchValue) && switchValue;
1212

1313
private EventHandler<NavigationEventArgs>? _onNavigateTo;
1414
public event EventHandler<NavigationEventArgs> OnNavigateTo

src/Components/test/E2ETest/ServerRenderingTests/NoInteractivityTest.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,12 @@ public void CanUseServerAuthenticationStateByDefault()
6565
Browser.Equal("True", () => Browser.FindElement(By.Id("is-in-test-role-2")).Text);
6666
}
6767

68-
[Fact]
69-
public void NavigatesWithoutInteractivityByRequestRedirection()
68+
[Theory]
69+
[InlineData(true)]
70+
[InlineData(false)]
71+
public void NavigatesWithoutInteractivityByRequestRedirection(bool controlFlowByException)
7072
{
73+
AppContext.SetSwitch("Microsoft.AspNetCore.Components.Endpoints.EnableThrowNavigationException", isEnabled: controlFlowByException);
7174
Navigate($"{ServerPathBase}/routing/ssr-navigate-to");
7275
Browser.Equal("Click submit to navigate to home", () => Browser.Exists(By.Id("test-info")).Text);
7376
Browser.Click(By.Id("redirectButton"));

0 commit comments

Comments
 (0)