Skip to content

Commit cd5dffa

Browse files
committed
Unify "fallback" pages - check for titles only.
1 parent d612592 commit cd5dffa

File tree

3 files changed

+10
-9
lines changed

3 files changed

+10
-9
lines changed

src/Components/test/E2ETest/ServerRenderingTests/NoInteractivityTest.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,7 @@ public void CanUseServerAuthenticationStateByDefault()
7070
public void CanRenderNotFoundPageAfterStreamingStarted()
7171
{
7272
Navigate($"{ServerPathBase}/streaming-set-not-found");
73-
Browser.WaitForElementToBeVisible(By.Id("test-info"));
74-
Browser.Equal("Default Not Found Page", () => Browser.Exists(By.Id("test-info")).Text);
73+
Browser.Equal("Default Not Found Page", () => Browser.Title);
7574
}
7675

7776
[Theory]

src/Components/test/E2ETest/ServerRenderingTests/StatusCodePagesTest.cs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,13 @@ public void StatusCodePagesWithReExecution(bool setNotFound, bool streaming)
3030
string streamingPath = streaming ? "streaming-" : "";
3131
Navigate($"{ServerPathBase}/reexecution/{streamingPath}set-not-found?shouldSet={setNotFound}");
3232

33-
string expectedTitle = setNotFound ? "Re-executed page" : "Original page";
34-
Browser.Equal(expectedTitle, () => Browser.Title);
35-
var infoText = Browser.FindElement(By.Id("test-info")).Text;
3633
// streaming when response started does not re-execute
37-
string expectedInfoText = streaming ? "Default Not Found Page" : setNotFound ? "Welcome On Page Re-executed After Not Found Event" : "Any content";
38-
Assert.Contains(expectedInfoText, infoText);
34+
string expectedTitle = streaming
35+
? "Default Not Found Page"
36+
: setNotFound
37+
? "Re-executed page"
38+
: "Original page";
39+
Browser.Equal(expectedTitle, () => Browser.Title);
3940
}
4041

4142
}
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
@page "/not-found"
22

3-
<h3 id="test-info">Default Not Found Page</h3>
4-
<p>This page is used for a workaround of NavigationManager.NotFound() method, used in SSR when the response already started and changing it to 404 is not possible.
3+
<PageTitle>Default Not Found Page</PageTitle>
4+
5+
<p id="test-info">This page is used for a workaround of NavigationManager.NotFound() method, used in SSR when the response already started and changing it to 404 is not possible.
56
This workaround triggers navigation to a constant "not-found" relative path.</p>

0 commit comments

Comments
 (0)