Add test case to show base-relative links work

This commit is contained in:
Steve Sanderson 2018-03-16 10:53:12 +00:00
parent a02ac60c8c
commit cb473e8ad7
2 changed files with 11 additions and 0 deletions

View File

@ -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()
{

View File

@ -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>