diff --git a/test/Microsoft.AspNetCore.Blazor.E2ETest/Tests/RoutingTest.cs b/test/Microsoft.AspNetCore.Blazor.E2ETest/Tests/RoutingTest.cs index 66a4bb1fd07d3699d31a48df2ef9bb2e2e42612b..8970de915cd0572ccd55b88420cfa8c5c5a5dcfc 100644 --- a/test/Microsoft.AspNetCore.Blazor.E2ETest/Tests/RoutingTest.cs +++ b/test/Microsoft.AspNetCore.Blazor.E2ETest/Tests/RoutingTest.cs @@ -50,6 +50,16 @@ namespace Microsoft.AspNetCore.Blazor.E2ETest.Tests Assert.Equal("This is another page.", app.FindElement(By.Id("test-info")).Text); } + [Fact] + public void CanFollowLinkToOtherPageWithBaseRelativeUrl() + { + SetUrlViaPushState($"{ServerPathBase}/RouterTest/"); + + var app = MountTestComponent<TestRouter>(); + app.FindElement(By.LinkText("Other with base-relative URL")).Click(); + Assert.Equal("This is another page.", app.FindElement(By.Id("test-info")).Text); + } + [Fact] public void CanFollowLinkToDefaultPage() { diff --git a/test/testapps/BasicTestApp/RouterTest/Links.cshtml b/test/testapps/BasicTestApp/RouterTest/Links.cshtml index 70efead6a4a774e0362a8d6e32b9136753e1b7e6..e7bbca5d1205900da6c831572e6e0c7f65947d91 100644 --- a/test/testapps/BasicTestApp/RouterTest/Links.cshtml +++ b/test/testapps/BasicTestApp/RouterTest/Links.cshtml @@ -3,6 +3,7 @@ <li><a href="/subdir/RouterTest/?abc=123">Default with query</a></li> <li><a href="/subdir/RouterTest/#blah">Default with hash</a></li> <li><a href="/subdir/RouterTest/Other">Other</a></li> + <li><a href="RouterTest/Other">Other with base-relative URL</a></li> <li><a href="/subdir/RouterTest/Other?abc=123">Other with query</a></li> <li><a href="/subdir/RouterTest/Other#blah">Other with hash</a></li> </ul>