Skip to content

Commit 147880f

Browse files
Components auth step 2 (#10293)
* CR feedback left over from #10227 * Begin adding E2E test case * Add cookie auth and test login page * Make E2E auth component work client-side too * Restructure auth E2E tests around a router so there can easily be multiple such test components * Add E2E test case for AuthorizeView * Prepare for E2E test implementations * Fix ToBaseRelativePath handling of hashes ... otherwise E2E test will fail, because we're using the hash to control server-or-client execution * Decouple E2E execution mode from hosting mode * Actual E2E tests for cascading authentication state * Actual E2E tests for AuthorizeView (in "no authentication rule" mode) * Fix inconsistent namespace * CR: Manual ref assembly definitions for AuthorizeView/CascadingAuthenticationState
1 parent 5502c20 commit 147880f

34 files changed

+434
-49
lines changed

eng/GenAPI.exclusions.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ T:Microsoft.AspNetCore.Components.RenderTree.RenderTreeFrame
44
T:Microsoft.AspNetCore.Mvc.ApplicationModels.PageParameterModel
55
T:Microsoft.AspNetCore.Mvc.ApplicationModels.PagePropertyModel
66
# Manually implemented - https://github.com/aspnet/AspNetCore/issues/8825
7+
T:Microsoft.AspNetCore.Components.AuthorizeView
8+
T:Microsoft.AspNetCore.Components.CascadingAuthenticationState
79
T:Microsoft.AspNetCore.Components.CascadingValue`1
810
T:Microsoft.AspNetCore.Components.Forms.DataAnnotationsValidator
911
T:Microsoft.AspNetCore.Components.Forms.EditForm

src/Components/Blazor/Blazor/test/WebAssemblyUriHelperTest.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ public void ComputesCorrectBaseUri(string baseUri, string expectedResult)
2929
[InlineData("scheme://host/path/", "scheme://host/path/", "")]
3030
[InlineData("scheme://host/path/", "scheme://host/path/more", "more")]
3131
[InlineData("scheme://host/path/", "scheme://host/path", "")]
32+
[InlineData("scheme://host/path/", "scheme://host/path#hash", "#hash")]
33+
[InlineData("scheme://host/path/", "scheme://host/path/#hash", "#hash")]
34+
[InlineData("scheme://host/path/", "scheme://host/path/more#hash", "more#hash")]
3235
public void ComputesCorrectValidBaseRelativePaths(string baseUri, string absoluteUri, string expectedResult)
3336
{
3437
var actualResult = _uriHelper.ToBaseRelativePath(baseUri, absoluteUri);

src/Components/Components/ref/Microsoft.AspNetCore.Components.netstandard2.0.Manual.cs

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,32 @@ public readonly partial struct RenderTreeFrame
4949
// Built-in components: https://github.com/aspnet/AspNetCore/issues/8825
5050
namespace Microsoft.AspNetCore.Components
5151
{
52+
public partial class AuthorizeView : Microsoft.AspNetCore.Components.ComponentBase
53+
{
54+
public AuthorizeView() { }
55+
[Microsoft.AspNetCore.Components.ParameterAttribute]
56+
public Microsoft.AspNetCore.Components.RenderFragment<Microsoft.AspNetCore.Components.AuthenticationState> Authorized { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } private set { throw null; } }
57+
[Microsoft.AspNetCore.Components.ParameterAttribute]
58+
public Microsoft.AspNetCore.Components.RenderFragment Authorizing { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } private set { throw null; } }
59+
[Microsoft.AspNetCore.Components.ParameterAttribute]
60+
public Microsoft.AspNetCore.Components.RenderFragment<Microsoft.AspNetCore.Components.AuthenticationState> ChildContent { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } private set { throw null; } }
61+
[Microsoft.AspNetCore.Components.ParameterAttribute]
62+
public Microsoft.AspNetCore.Components.RenderFragment NotAuthorized { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } private set { throw null; } }
63+
protected override void BuildRenderTree(Microsoft.AspNetCore.Components.RenderTree.RenderTreeBuilder builder) { }
64+
[System.Diagnostics.DebuggerStepThroughAttribute]
65+
protected override System.Threading.Tasks.Task OnParametersSetAsync() { throw null; }
66+
}
67+
68+
public partial class CascadingAuthenticationState : Microsoft.AspNetCore.Components.ComponentBase, System.IDisposable
69+
{
70+
public CascadingAuthenticationState() { }
71+
[Microsoft.AspNetCore.Components.ParameterAttribute]
72+
public Microsoft.AspNetCore.Components.RenderFragment ChildContent { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } private set { throw null; } }
73+
protected override void BuildRenderTree(Microsoft.AspNetCore.Components.RenderTree.RenderTreeBuilder builder) { }
74+
protected override void OnInit() { }
75+
void System.IDisposable.Dispose() { }
76+
}
77+
5278
public partial class CascadingValue<T> : Microsoft.AspNetCore.Components.IComponent
5379
{
5480
public CascadingValue() { }

src/Components/Components/ref/Microsoft.AspNetCore.Components.netstandard2.0.cs

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,6 @@ public event Microsoft.AspNetCore.Components.AuthenticationStateChangedHandler A
1616
public abstract System.Threading.Tasks.Task<Microsoft.AspNetCore.Components.AuthenticationState> GetAuthenticationStateAsync();
1717
protected void NotifyAuthenticationStateChanged(System.Threading.Tasks.Task<Microsoft.AspNetCore.Components.AuthenticationState> task) { }
1818
}
19-
public partial class AuthorizeView : Microsoft.AspNetCore.Components.ComponentBase
20-
{
21-
public AuthorizeView() { }
22-
[Microsoft.AspNetCore.Components.ParameterAttribute]
23-
public Microsoft.AspNetCore.Components.RenderFragment<Microsoft.AspNetCore.Components.AuthenticationState> Authorized { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } }
24-
[Microsoft.AspNetCore.Components.ParameterAttribute]
25-
public Microsoft.AspNetCore.Components.RenderFragment Authorizing { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } }
26-
[Microsoft.AspNetCore.Components.ParameterAttribute]
27-
public Microsoft.AspNetCore.Components.RenderFragment<Microsoft.AspNetCore.Components.AuthenticationState> ChildContent { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } }
28-
[Microsoft.AspNetCore.Components.ParameterAttribute]
29-
public Microsoft.AspNetCore.Components.RenderFragment NotAuthorized { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } }
30-
protected override void BuildRenderTree(Microsoft.AspNetCore.Components.RenderTree.RenderTreeBuilder builder) { }
31-
[System.Diagnostics.DebuggerStepThroughAttribute]
32-
protected override System.Threading.Tasks.Task OnParametersSetAsync() { throw null; }
33-
}
3419
[Microsoft.AspNetCore.Components.BindElementAttribute("select", null, "value", "onchange")]
3520
[Microsoft.AspNetCore.Components.BindElementAttribute("textarea", null, "value", "onchange")]
3621
[Microsoft.AspNetCore.Components.BindInputElementAttribute("checkbox", null, "checked", "onchange")]
@@ -85,15 +70,6 @@ public static partial class BindMethods
8570
public static System.Action<Microsoft.AspNetCore.Components.UIEventArgs> SetValueHandler(System.Action<string> setter, string existingValue) { throw null; }
8671
public static System.Action<Microsoft.AspNetCore.Components.UIEventArgs> SetValueHandler<T>(System.Action<T> setter, T existingValue) { throw null; }
8772
}
88-
public partial class CascadingAuthenticationState : Microsoft.AspNetCore.Components.ComponentBase, System.IDisposable
89-
{
90-
public CascadingAuthenticationState() { }
91-
[Microsoft.AspNetCore.Components.ParameterAttribute]
92-
public Microsoft.AspNetCore.Components.RenderFragment ChildContent { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } }
93-
protected override void BuildRenderTree(Microsoft.AspNetCore.Components.RenderTree.RenderTreeBuilder builder) { }
94-
protected override void OnInit() { }
95-
void System.IDisposable.Dispose() { }
96-
}
9773
[System.AttributeUsageAttribute(System.AttributeTargets.Property, AllowMultiple=false, Inherited=false)]
9874
public sealed partial class CascadingParameterAttribute : System.Attribute
9975
{

src/Components/Components/src/Auth/AuthenticationState.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,6 @@ namespace Microsoft.AspNetCore.Components
1111
/// </summary>
1212
public class AuthenticationState
1313
{
14-
/// <summary>
15-
/// Gets a <see cref="ClaimsPrincipal"/> that describes the current user.
16-
/// </summary>
17-
public ClaimsPrincipal User { get; }
18-
1914
/// <summary>
2015
/// Constructs an instance of <see cref="AuthenticationState"/>.
2116
/// </summary>
@@ -24,5 +19,10 @@ public AuthenticationState(ClaimsPrincipal user)
2419
{
2520
User = user ?? throw new ArgumentNullException(nameof(user));
2621
}
22+
23+
/// <summary>
24+
/// Gets a <see cref="ClaimsPrincipal"/> that describes the current user.
25+
/// </summary>
26+
public ClaimsPrincipal User { get; }
2727
}
2828
}

src/Components/Components/src/Auth/AuthenticationStateProvider.cs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,16 @@ namespace Microsoft.AspNetCore.Components
1212
public abstract class AuthenticationStateProvider
1313
{
1414
/// <summary>
15-
/// Gets an <see cref="AuthenticationState"/> instance that describes
16-
/// the current user.
15+
/// Asynchronously gets an <see cref="AuthenticationState"/> that describes the current user.
1716
/// </summary>
18-
/// <returns>An <see cref="AuthenticationState"/> instance that describes the current user.</returns>
17+
/// <returns>A task that, when resolved, gives an <see cref="AuthenticationState"/> instance that describes the current user.</returns>
1918
public abstract Task<AuthenticationState> GetAuthenticationStateAsync();
2019

2120
/// <summary>
2221
/// An event that provides notification when the <see cref="AuthenticationState"/>
2322
/// has changed. For example, this event may be raised if a user logs in or out.
2423
/// </summary>
25-
#pragma warning disable 0067 // "Never used" (it's only raised by subclasses)
2624
public event AuthenticationStateChangedHandler AuthenticationStateChanged;
27-
#pragma warning restore 0067
2825

2926
/// <summary>
3027
/// Raises the <see cref="AuthenticationStateChanged"/> event.

src/Components/Components/src/UriHelperBase.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,15 +154,18 @@ public string ToBaseRelativePath(string baseUri, string locationAbsolute)
154154
// baseUri ends with a slash), and from that we return "something"
155155
return locationAbsolute.Substring(baseUri.Length);
156156
}
157-
else if ($"{locationAbsolute}/".Equals(baseUri, StringComparison.Ordinal))
157+
158+
var hashIndex = locationAbsolute.IndexOf('#');
159+
var locationAbsoluteNoHash = hashIndex < 0 ? locationAbsolute : locationAbsolute.Substring(0, hashIndex);
160+
if ($"{locationAbsoluteNoHash}/".Equals(baseUri, StringComparison.Ordinal))
158161
{
159162
// Special case: for the base URI "/something/", if you're at
160163
// "/something" then treat it as if you were at "/something/" (i.e.,
161164
// with the trailing slash). It's a bit ambiguous because we don't know
162165
// whether the server would return the same page whether or not the
163166
// slash is present, but ASP.NET Core at least does by default when
164167
// using PathBase.
165-
return string.Empty;
168+
return locationAbsolute.Substring(baseUri.Length - 1);
166169
}
167170

168171
var message = $"The URI '{locationAbsolute}' is not contained by the base URI '{baseUri}'.";

src/Components/test/E2ETest/Infrastructure/BasicTestAppTestBase.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ namespace Microsoft.AspNetCore.Components.E2ETest.Infrastructure
1515
public class BasicTestAppTestBase : ServerTestBase<ToggleExecutionModeServerFixture<Program>>
1616
{
1717
public string ServerPathBase
18-
=> "/subdir" + (_serverFixture.UsingAspNetHost ? "#server" : "");
18+
=> "/subdir" + (_serverFixture.ExecutionMode == ExecutionMode.Server ? "#server" : "");
1919

2020
public BasicTestAppTestBase(
2121
BrowserFixture browserFixture,

src/Components/test/E2ETest/Infrastructure/ServerFixtures/ToggleExecutionModeServerFixture.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ public class ToggleExecutionModeServerFixture<TClientProgram>
99
: ServerFixture
1010
{
1111
public string PathBase { get; set; }
12-
public bool UsingAspNetHost { get; private set; }
12+
13+
public ExecutionMode ExecutionMode { get; set; } = ExecutionMode.Client;
1314

1415
private AspNetSiteServerFixture.BuildWebHost _buildWebHostMethod;
1516
private IDisposable _serverToDispose;
@@ -18,7 +19,6 @@ public void UseAspNetHost(AspNetSiteServerFixture.BuildWebHost buildWebHostMetho
1819
{
1920
_buildWebHostMethod = buildWebHostMethod
2021
?? throw new ArgumentNullException(nameof(buildWebHostMethod));
21-
UsingAspNetHost = true;
2222
}
2323

2424
protected override string StartAndGetRootUri()
@@ -46,4 +46,6 @@ public override void Dispose()
4646
_serverToDispose?.Dispose();
4747
}
4848
}
49+
50+
public enum ExecutionMode { Client, Server }
4951
}

src/Components/test/E2ETest/ServerExecutionTests/PrerenderingTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
using Xunit;
99
using Xunit.Abstractions;
1010

11-
namespace Microsoft.AspNetCore.Components.E2ETests.ServerExecutionTests
11+
namespace Microsoft.AspNetCore.Components.E2ETest.ServerExecutionTests
1212
{
1313
public class PrerenderingTest : ServerTestBase<AspNetSiteServerFixture>
1414
{

src/Components/test/E2ETest/ServerExecutionTests/ServerExecutionTestExtensions.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ internal static class ServerExecutionTestExtensions
1010
public static ToggleExecutionModeServerFixture<T> WithServerExecution<T>(this ToggleExecutionModeServerFixture<T> serverFixture)
1111
{
1212
serverFixture.UseAspNetHost(TestServer.Program.BuildWebHost);
13+
serverFixture.ExecutionMode = ExecutionMode.Server;
1314
return serverFixture;
1415
}
1516
}

src/Components/test/E2ETest/ServerExecutionTests/TestSubclasses.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,4 +81,12 @@ public ServerKeyTest(BrowserFixture browserFixture, ToggleExecutionModeServerFix
8181
{
8282
}
8383
}
84+
85+
public class ServerAuthTest : AuthTest
86+
{
87+
public ServerAuthTest(BrowserFixture browserFixture, ToggleExecutionModeServerFixture<Program> serverFixture, ITestOutputHelper output)
88+
: base(browserFixture, serverFixture.WithServerExecution(), output)
89+
{
90+
}
91+
}
8492
}
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
// Copyright (c) .NET Foundation. All rights reserved.
2+
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
3+
4+
using BasicTestApp;
5+
using Microsoft.AspNetCore.Components.E2ETest.Infrastructure;
6+
using Microsoft.AspNetCore.Components.E2ETest.Infrastructure.ServerFixtures;
7+
using Microsoft.AspNetCore.E2ETesting;
8+
using OpenQA.Selenium;
9+
using Xunit;
10+
using Xunit.Abstractions;
11+
12+
namespace Microsoft.AspNetCore.Components.E2ETest.Tests
13+
{
14+
public class AuthTest : BasicTestAppTestBase
15+
{
16+
// These strings correspond to the links in BasicTestApp\AuthTest\Links.razor
17+
const string CascadingAuthenticationStateLink = "Cascading authentication state";
18+
const string AuthorizeViewCases = "AuthorizeView cases";
19+
20+
public AuthTest(
21+
BrowserFixture browserFixture,
22+
ToggleExecutionModeServerFixture<Program> serverFixture,
23+
ITestOutputHelper output)
24+
: base(browserFixture, serverFixture, output)
25+
{
26+
// Normally, the E2E tests use the Blazor dev server if they are testing
27+
// client-side execution. But for the auth tests, we always have to run
28+
// in "hosted on ASP.NET Core" mode, because we get the auth state from it.
29+
serverFixture.UseAspNetHost(TestServer.Program.BuildWebHost);
30+
}
31+
32+
[Fact]
33+
public void CascadingAuthenticationState_Unauthenticated()
34+
{
35+
SignInAs(null);
36+
37+
var appElement = MountAndNavigateToAuthTest(CascadingAuthenticationStateLink);
38+
39+
Browser.Equal("False", () => appElement.FindElement(By.Id("identity-authenticated")).Text);
40+
Browser.Equal(string.Empty, () => appElement.FindElement(By.Id("identity-name")).Text);
41+
Browser.Equal("(none)", () => appElement.FindElement(By.Id("test-claim")).Text);
42+
}
43+
44+
[Fact]
45+
public void CascadingAuthenticationState_Authenticated()
46+
{
47+
SignInAs("someone cool");
48+
49+
var appElement = MountAndNavigateToAuthTest(CascadingAuthenticationStateLink);
50+
51+
Browser.Equal("True", () => appElement.FindElement(By.Id("identity-authenticated")).Text);
52+
Browser.Equal("someone cool", () => appElement.FindElement(By.Id("identity-name")).Text);
53+
Browser.Equal("Test claim value", () => appElement.FindElement(By.Id("test-claim")).Text);
54+
}
55+
56+
[Fact]
57+
public void AuthorizeViewCases_NoAuthorizationRule_Unauthenticated()
58+
{
59+
SignInAs(null);
60+
MountAndNavigateToAuthTest(AuthorizeViewCases);
61+
WaitUntilExists(By.CssSelector("#no-authorization-rule .not-authorized"));
62+
}
63+
64+
[Fact]
65+
public void AuthorizeViewCases_NoAuthorizationRule_Authenticated()
66+
{
67+
SignInAs("Some User");
68+
var appElement = MountAndNavigateToAuthTest(AuthorizeViewCases);
69+
Browser.Equal("Welcome, Some User!", () =>
70+
appElement.FindElement(By.CssSelector("#no-authorization-rule .authorized")).Text);
71+
}
72+
73+
IWebElement MountAndNavigateToAuthTest(string authLinkText)
74+
{
75+
Navigate(ServerPathBase);
76+
var appElement = MountTestComponent<BasicTestApp.AuthTest.AuthRouter>();
77+
WaitUntilExists(By.Id("auth-links"));
78+
appElement.FindElement(By.LinkText(authLinkText)).Click();
79+
return appElement;
80+
}
81+
82+
void SignInAs(string usernameOrNull)
83+
{
84+
const string authenticationPageUrl = "/Authentication";
85+
var baseRelativeUri = usernameOrNull == null
86+
? $"{authenticationPageUrl}?signout=true"
87+
: $"{authenticationPageUrl}?username={usernameOrNull}";
88+
Navigate(baseRelativeUri);
89+
WaitUntilExists(By.CssSelector("h1#authentication"));
90+
}
91+
}
92+
}

src/Components/test/E2ETest/Tests/BindTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public BindTest(
2525
protected override void InitializeAsyncCore()
2626
{
2727
// On WebAssembly, page reloads are expensive so skip if possible
28-
Navigate(ServerPathBase, noReload: !_serverFixture.UsingAspNetHost);
28+
Navigate(ServerPathBase, noReload: _serverFixture.ExecutionMode == ExecutionMode.Client);
2929
MountTestComponent<BindCasesComponent>();
3030
WaitUntilExists(By.Id("bind-cases"));
3131
}

src/Components/test/E2ETest/Tests/CascadingValueTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public CascadingValueTest(
2424

2525
protected override void InitializeAsyncCore()
2626
{
27-
Navigate(ServerPathBase, noReload: !_serverFixture.UsingAspNetHost);
27+
Navigate(ServerPathBase, noReload: _serverFixture.ExecutionMode == ExecutionMode.Client);
2828
MountTestComponent<BasicTestApp.CascadingValueTest.CascadingValueSupplier>();
2929
}
3030

src/Components/test/E2ETest/Tests/ComponentRenderingTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public ComponentRenderingTest(
3131

3232
protected override void InitializeAsyncCore()
3333
{
34-
Navigate(ServerPathBase, noReload: !_serverFixture.UsingAspNetHost);
34+
Navigate(ServerPathBase, noReload: _serverFixture.ExecutionMode == ExecutionMode.Client);
3535
}
3636

3737
[Fact]

src/Components/test/E2ETest/Tests/EventBubblingTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public EventBubblingTest(
3131

3232
protected override void InitializeAsyncCore()
3333
{
34-
Navigate(ServerPathBase, noReload: !_serverFixture.UsingAspNetHost);
34+
Navigate(ServerPathBase, noReload: _serverFixture.ExecutionMode == ExecutionMode.Client);
3535
MountTestComponent<EventBubblingComponent>();
3636
WaitUntilExists(By.Id("event-bubbling"));
3737
}

src/Components/test/E2ETest/Tests/EventCallbackTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public EventCallbackTest(
2525
protected override void InitializeAsyncCore()
2626
{
2727
// On WebAssembly, page reloads are expensive so skip if possible
28-
Navigate(ServerPathBase, noReload: !_serverFixture.UsingAspNetHost);
28+
Navigate(ServerPathBase, noReload: _serverFixture.ExecutionMode == ExecutionMode.Client);
2929
MountTestComponent<BasicTestApp.EventCallbackTest.EventCallbackCases>();
3030
}
3131

src/Components/test/E2ETest/Tests/FormsTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public FormsTest(
3131
protected override void InitializeAsyncCore()
3232
{
3333
// On WebAssembly, page reloads are expensive so skip if possible
34-
Navigate(ServerPathBase, noReload: !_serverFixture.UsingAspNetHost);
34+
Navigate(ServerPathBase, noReload: _serverFixture.ExecutionMode == ExecutionMode.Client);
3535
}
3636

3737
[Fact]

src/Components/test/E2ETest/Tests/InteropTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ public void CanInvokeDotNetMethods()
104104

105105
// Include the sync assertions only when running under WebAssembly
106106
var expectedValues = expectedAsyncValues;
107-
if (!_serverFixture.UsingAspNetHost)
107+
if (_serverFixture.ExecutionMode == ExecutionMode.Client)
108108
{
109109
foreach (var kvp in expectedSyncValues)
110110
{

src/Components/test/E2ETest/Tests/KeyTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public KeyTest(
3030
protected override void InitializeAsyncCore()
3131
{
3232
// On WebAssembly, page reloads are expensive so skip if possible
33-
Navigate(ServerPathBase, noReload: !_serverFixture.UsingAspNetHost);
33+
Navigate(ServerPathBase, noReload: _serverFixture.ExecutionMode == ExecutionMode.Client);
3434
}
3535

3636
[Fact]
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
@page "/AuthHome"
2+
3+
Select an auth test below.

0 commit comments

Comments
 (0)