From cb473e8ad77d6c42a72f0e81deb5feea55517d38 Mon Sep 17 00:00:00 2001 From: Steve Sanderson Date: Fri, 16 Mar 2018 10:53:12 +0000 Subject: [PATCH] Add test case to show base-relative links work --- .../Tests/RoutingTest.cs | 10 ++++++++++ test/testapps/BasicTestApp/RouterTest/Links.cshtml | 1 + 2 files changed, 11 insertions(+) diff --git a/test/Microsoft.AspNetCore.Blazor.E2ETest/Tests/RoutingTest.cs b/test/Microsoft.AspNetCore.Blazor.E2ETest/Tests/RoutingTest.cs index 66a4bb1fd0..8970de915c 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(); + 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 70efead6a4..e7bbca5d12 100644 --- a/test/testapps/BasicTestApp/RouterTest/Links.cshtml +++ b/test/testapps/BasicTestApp/RouterTest/Links.cshtml @@ -3,6 +3,7 @@
  • Default with query
  • Default with hash
  • Other
  • +
  • Other with base-relative URL
  • Other with query
  • Other with hash