Skip to content

Commit

Permalink
Fix routing test (#47963)
Browse files Browse the repository at this point in the history
  • Loading branch information
MackinnonBuck authored Apr 28, 2023
1 parent b2ce346 commit 8f36789
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Components/test/E2ETest/Tests/RoutingTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1572,14 +1572,14 @@ public void AnchorWithHrefContainingHashAnotherPage_NavigatesToPageAndScrollsToE
app.FindElement(By.Id("anchor-test2")).Click();

var currentWindowScrollY = BrowserScrollY;
var test2VerticalLocation = app.FindElement(By.Name("test2")).Location.Y;
var test2VerticalLocation = app.FindElement(By.Id("test2")).Location.Y;
var currentRelativeUrl = _serverFixture.RootUri.MakeRelativeUri(new Uri(Browser.Url)).ToString();
Assert.Equal("subdir/LongPageWithHash2#test2", currentRelativeUrl);
Assert.Equal(test2VerticalLocation, currentWindowScrollY);
}

[Fact]
public void NavigatationManagerNavigateToSameUrlWithHash_ScrollsToElementOnTheSamePage()
public void NavigationManagerNavigateToSameUrlWithHash_ScrollsToElementOnTheSamePage()
{
SetUrlViaPushState("/");
var app = Browser.MountTestComponent<TestRouter>();
Expand All @@ -1588,14 +1588,14 @@ public void NavigatationManagerNavigateToSameUrlWithHash_ScrollsToElementOnTheSa
app.FindElement(By.Id("navigate-test2")).Click();

var currentWindowScrollY = BrowserScrollY;
var test2VerticalLocation = app.FindElement(By.Name("test2")).Location.Y;
var test2VerticalLocation = app.FindElement(By.Id("test2")).Location.Y;
var currentRelativeUrl = _serverFixture.RootUri.MakeRelativeUri(new Uri(Browser.Url)).ToString();
Assert.Equal("subdir/LongPageWithHash2#test2", currentRelativeUrl);
Assert.Equal(test2VerticalLocation, currentWindowScrollY);
}

[Fact]
public void NavigatationManagerNavigateToAnotherUrlWithHash_NavigatesToPageAndScrollsToElement()
public void NavigationManagerNavigateToAnotherUrlWithHash_NavigatesToPageAndScrollsToElement()
{
SetUrlViaPushState("/");
var app = Browser.MountTestComponent<TestRouter>();
Expand Down

0 comments on commit 8f36789

Please sign in to comment.