Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,8 @@ public NavigationLockPrerenderingTest(
public override Task InitializeAsync()
=> InitializeAsync(BrowserFixture.RoutingTestContext);

[Fact]
[QuarantinedTest("https://github.com/dotnet/aspnetcore/issues/57153")]
public void NavigationIsLockedAfterPrerendering()
[Fact(Skip = "https://github.com/dotnet/aspnetcore/issues/57153")]
public void ExternalNavigationIsLockedAfterPrerendering()
{
Navigate("/locked-navigation");

Expand All @@ -35,13 +34,24 @@ public void NavigationIsLockedAfterPrerendering()

BeginInteractivity();

// Assert that internal navigations are blocked
Browser.Click(By.Id("internal-navigation-link"));
Browser.Equal("Prevented navigations: 1", () => Browser.FindElement(By.Id("num-prevented-navigations")).Text);

// Assert that external navigations are blocked
Browser.Navigate().GoToUrl("about:blank");
Browser.SwitchTo().Alert().Dismiss();
Browser.Equal("Prevented navigations: 0", () => Browser.FindElement(By.Id("num-prevented-navigations")).Text);
}

[Fact]
public void InternalNavigationIsLockedAfterPrerendering()
{
Navigate("/locked-navigation");

// Assert that the component rendered successfully
Browser.Equal("Prevented navigations: 0", () => Browser.FindElement(By.Id("num-prevented-navigations")).Text);

BeginInteractivity();

// Assert that internal navigations are blocked
Browser.Click(By.Id("internal-navigation-link"));
Browser.Equal("Prevented navigations: 1", () => Browser.FindElement(By.Id("num-prevented-navigations")).Text);
}

Expand Down
3 changes: 1 addition & 2 deletions src/Components/test/E2ETest/Tests/RoutingTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1155,8 +1155,7 @@ public void NavigationLock_HistoryNavigationWorks_AfterRefresh()
Browser.Equal("1", () => app.FindElement(By.Id("location-changed-count"))?.Text);
}

[Fact]
[QuarantinedTest("https://github.com/dotnet/aspnetcore/issues/57153")]
[Fact(Skip = "https://github.com/dotnet/aspnetcore/issues/57153")]
public void NavigationLock_CanBlockExternalNavigation()
{
SetUrlViaPushState("/");
Expand Down
Loading