Skip to content

Commit f3dd124

Browse files
Make E2E prerendering test use static prerendering (we no longer need coverage for stateful prerendering)
1 parent 519ec83 commit f3dd124

File tree

2 files changed

+13
-12
lines changed

2 files changed

+13
-12
lines changed

src/Components/test/testassets/TestServer/Pages/PrerenderedHost.cshtml

+11-11
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<base href="~/" />
88
</head>
99
<body>
10-
<app>@(await Html.RenderComponentAsync<TestRouter>())</app>
10+
<app>@(await Html.RenderStaticComponentAsync<TestRouter>())</app>
1111

1212
@*
1313
So that E2E tests can make assertions about both the prerendered and
@@ -19,17 +19,17 @@
1919

2020
<script src="_framework/blazor.server.js" autostart="false"></script>
2121
<script>
22-
// Used by InteropOnInitializationComponent
23-
function setElementValue(element, newValue) {
24-
element.value = newValue;
25-
return element.value;
26-
}
22+
// Used by InteropOnInitializationComponent
23+
function setElementValue(element, newValue) {
24+
element.value = newValue;
25+
return element.value;
26+
}
2727
28-
function start() {
29-
Blazor.start({
30-
logLevel: 1 // LogLevel.Debug
31-
});
32-
}
28+
function start() {
29+
Blazor.start({
30+
logLevel: 1 // LogLevel.Debug
31+
});
32+
}
3333
</script>
3434
</body>
3535
</html>

src/Components/test/testassets/TestServer/Startup.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System.Threading.Tasks;
22
using BasicTestApp;
3+
using BasicTestApp.RouterTest;
34
using Microsoft.AspNetCore.Authentication.Cookies;
45
using Microsoft.AspNetCore.Builder;
56
using Microsoft.AspNetCore.Hosting;
@@ -96,7 +97,7 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
9697
app.UseEndpoints(endpoints =>
9798
{
9899
endpoints.MapFallbackToPage("/PrerenderedHost");
99-
endpoints.MapBlazorHub();
100+
endpoints.MapBlazorHub<TestRouter>(selector: "app");
100101
});
101102
});
102103

0 commit comments

Comments
 (0)