mbproxy: close out the dashboard code-review minor findings
Resolves the remaining Minor items from the 2026-05-15 review so the web-UI dashboard work has no open follow-ups: a real-HubConnection end-to-end test for the SignalR feed, stable mbproxy.admin.broadcast.* log-event names, keyboard/aria accessibility on the fleet table, frontend JS hardening (URL-decode guard, NaN guards, shared util.js), reconciler<->capture-registry coverage, throwing-sink and embedded-asset tests, broadcaster polish, and a soft upper bound on AdminPushIntervalMs. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -243,7 +243,22 @@ public sealed class AdminEndpointTests
|
||||
response.Headers.CacheControl?.ToString().ShouldContain("immutable");
|
||||
|
||||
var bytes = await response.Content.ReadAsByteArrayAsync(TestContext.Current.CancellationToken);
|
||||
bytes.Length.ShouldBeGreaterThan(0);
|
||||
|
||||
// The served bytes must be the actual embedded asset — not some other resource
|
||||
// of the same length. Compare against the manifest resource directly.
|
||||
byte[] expected = ReadEmbeddedAsset(file);
|
||||
bytes.ShouldBe(expected, $"GET /assets/{file} must return the embedded asset verbatim");
|
||||
}
|
||||
|
||||
/// <summary>Reads a <c>wwwroot</c> asset straight from the assembly's manifest resources.</summary>
|
||||
private static byte[] ReadEmbeddedAsset(string fileName)
|
||||
{
|
||||
using var stream = typeof(Mbproxy.Admin.StatusHub).Assembly
|
||||
.GetManifestResourceStream("Mbproxy.Admin.wwwroot." + fileName)
|
||||
?? throw new InvalidOperationException($"Embedded asset not found: {fileName}");
|
||||
using var ms = new MemoryStream();
|
||||
stream.CopyTo(ms);
|
||||
return ms.ToArray();
|
||||
}
|
||||
|
||||
[Fact(Timeout = 5_000)]
|
||||
|
||||
Reference in New Issue
Block a user