Skip to content

Commit 56ec592

Browse files
authored
Skip unfixable NavigationLock tests, split internal navigation lock test (#63557)
1 parent 8b5601d commit 56ec592

File tree

2 files changed

+18
-9
lines changed

2 files changed

+18
-9
lines changed

src/Components/test/E2ETest/ServerExecutionTests/NavigationLockPrerenderingTest.cs

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,8 @@ public NavigationLockPrerenderingTest(
2424
public override Task InitializeAsync()
2525
=> InitializeAsync(BrowserFixture.RoutingTestContext);
2626

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

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

3635
BeginInteractivity();
3736

38-
// Assert that internal navigations are blocked
39-
Browser.Click(By.Id("internal-navigation-link"));
40-
Browser.Equal("Prevented navigations: 1", () => Browser.FindElement(By.Id("num-prevented-navigations")).Text);
41-
4237
// Assert that external navigations are blocked
4338
Browser.Navigate().GoToUrl("about:blank");
4439
Browser.SwitchTo().Alert().Dismiss();
40+
Browser.Equal("Prevented navigations: 0", () => Browser.FindElement(By.Id("num-prevented-navigations")).Text);
41+
}
42+
43+
[Fact]
44+
public void InternalNavigationIsLockedAfterPrerendering()
45+
{
46+
Navigate("/locked-navigation");
47+
48+
// Assert that the component rendered successfully
49+
Browser.Equal("Prevented navigations: 0", () => Browser.FindElement(By.Id("num-prevented-navigations")).Text);
50+
51+
BeginInteractivity();
52+
53+
// Assert that internal navigations are blocked
54+
Browser.Click(By.Id("internal-navigation-link"));
4555
Browser.Equal("Prevented navigations: 1", () => Browser.FindElement(By.Id("num-prevented-navigations")).Text);
4656
}
4757

src/Components/test/E2ETest/Tests/RoutingTest.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1155,8 +1155,7 @@ public void NavigationLock_HistoryNavigationWorks_AfterRefresh()
11551155
Browser.Equal("1", () => app.FindElement(By.Id("location-changed-count"))?.Text);
11561156
}
11571157

1158-
[Fact]
1159-
[QuarantinedTest("https://github.com/dotnet/aspnetcore/issues/57153")]
1158+
[Fact(Skip = "https://github.com/dotnet/aspnetcore/issues/57153")]
11601159
public void NavigationLock_CanBlockExternalNavigation()
11611160
{
11621161
SetUrlViaPushState("/");

0 commit comments

Comments
 (0)