diff --git a/src/Components/test/E2ETest/ServerExecutionTests/StreamingRenderingTest.cs b/src/Components/test/E2ETest/ServerExecutionTests/StreamingRenderingTest.cs index 5d0b35b55297..4091ae807d86 100644 --- a/src/Components/test/E2ETest/ServerExecutionTests/StreamingRenderingTest.cs +++ b/src/Components/test/E2ETest/ServerExecutionTests/StreamingRenderingTest.cs @@ -64,4 +64,20 @@ public void CanPerformStreamingRendering() Browser.FindElement(By.Id("end-response-link")).Click(); Browser.Equal("Finished", () => getStatusText().Text); } + + [Fact] + public void CanPerformFormPostWithStreamedResponses() + { + Navigate($"{ServerPathBase}/form-streaming"); + + // Initial "waiting" state + var submit = Browser.Exists(By.CssSelector("input[type=submit]")); + var getStatusText = () => Browser.Exists(By.Id("status")); + Assert.Equal("", getStatusText().Text); + + submit.Click(); + + Assert.Equal("Processing form...", getStatusText().Text); + Assert.Equal("Completed", getStatusText().Text); + } } diff --git a/src/Components/test/testassets/Components.TestServer/RazorComponents/Pages/FormStreamingRendering.razor b/src/Components/test/testassets/Components.TestServer/RazorComponents/Pages/FormStreamingRendering.razor new file mode 100644 index 000000000000..84cf118e6aaa --- /dev/null +++ b/src/Components/test/testassets/Components.TestServer/RazorComponents/Pages/FormStreamingRendering.razor @@ -0,0 +1,36 @@ +@page "/form-streaming" +@using Microsoft.AspNetCore.Components.Forms +@attribute [StreamRendering(true)] + +
+ @if (_processing)
+ {
+