Skip to content

Commit 466706c

Browse files
committed
Add comments, simplify test component, clean up sample app
1 parent c7276ae commit 466706c

File tree

11 files changed

+20
-423
lines changed

11 files changed

+20
-423
lines changed

src/Components/Samples/BlazorUnitedApp/App.razor

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,6 @@
1515
</head>
1616
<body>
1717
<Routes />
18-
<ReconnectModal></ReconnectModal>
19-
<script src="@Assets["_framework/blazor.web.js"]" autostart="false"></script>
20-
<script>
21-
Blazor.start({
22-
circuit: {
23-
reconnectionOptions: {
24-
maxRetries: 12,
25-
retryIntervalMilliseconds: 5000,
26-
},
27-
},
28-
});
29-
</script>
18+
<script src="@Assets["_framework/blazor.web.js"]"></script>
3019
</body>
3120
</html>

src/Components/Samples/BlazorUnitedApp/Shared/ReconnectModal.razor

Lines changed: 0 additions & 22 deletions
This file was deleted.

src/Components/Samples/BlazorUnitedApp/Shared/ReconnectModal.razor.css

Lines changed: 0 additions & 151 deletions
This file was deleted.

src/Components/Samples/BlazorUnitedApp/Shared/ReconnectModal.razor.js

Lines changed: 0 additions & 30 deletions
This file was deleted.

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

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,17 @@ public ServerReconnectionCustomUITest(
2626

2727
protected override void InitializeAsyncCore()
2828
{
29+
/// Setting this query parameter causes <see cref="ReconnectionComponent"/> to include the custom reconnect dialog.
2930
Navigate($"{ServerPathBase}?useCustomReconnectModal=true");
3031
Browser.MountTestComponent<ReconnectionComponent>();
3132
Browser.Exists(By.Id("count"));
3233
}
3334

35+
/// <summary>
36+
/// Tests that the custom reconnect is displayed when the server circuit is disconnected.
37+
/// This UI is provided statically by a Razor component instead being generated by the default
38+
/// JS fallback code (see 'DefaultReconnectDisplay.ts').
39+
/// </summary>
3440
[Fact]
3541
public void CustomReconnectUIIsDisplayed()
3642
{
@@ -56,6 +62,9 @@ public void CustomReconnectUIIsDisplayed()
5662
Browser.Equal("2", () => Browser.Exists(By.Id("count")).Text);
5763
}
5864

65+
/// <summary>
66+
/// Tests that when the custom reconnect UI is used, there are no style-related CSP errors.
67+
/// </summary>
5968
[Fact]
6069
public void StyleSrcCSPIsNotViolated()
6170
{
@@ -66,9 +75,9 @@ public void StyleSrcCSPIsNotViolated()
6675
Browser.Equal("block", () => Browser.Exists(By.Id("components-reconnect-modal")).GetCssValue("display"));
6776

6877
// Check that there is no CSP-related error in the browser console
78+
var cspErrorMessage = "violates the following Content Security Policy directive: \"style-src";
6979
var logs = Browser.Manage().Logs.GetLog(LogType.Browser);
70-
var styleErrors = logs.Where(
71-
log => log.Message.Contains("Refused to apply inline style because it violates the following Content Security Policy directive"));
80+
var styleErrors = logs.Where(log => log.Message.Contains(cspErrorMessage));
7281

7382
Assert.Empty(styleErrors);
7483
}

src/Components/test/testassets/BasicTestApp/Reconnection/ReconnectModal.razor

Lines changed: 0 additions & 22 deletions
This file was deleted.

0 commit comments

Comments
 (0)