Add test case to show base-relative links work
This commit is contained in:
parent
a02ac60c8c
commit
cb473e8ad7
|
|
@ -50,6 +50,16 @@ namespace Microsoft.AspNetCore.Blazor.E2ETest.Tests
|
||||||
Assert.Equal("This is another page.", app.FindElement(By.Id("test-info")).Text);
|
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]
|
[Fact]
|
||||||
public void CanFollowLinkToDefaultPage()
|
public void CanFollowLinkToDefaultPage()
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@
|
||||||
<li><a href="/subdir/RouterTest/?abc=123">Default with query</a></li>
|
<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/#blah">Default with hash</a></li>
|
||||||
<li><a href="/subdir/RouterTest/Other">Other</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?abc=123">Other with query</a></li>
|
||||||
<li><a href="/subdir/RouterTest/Other#blah">Other with hash</a></li>
|
<li><a href="/subdir/RouterTest/Other#blah">Other with hash</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue