docs(tests): fix CommentChecker findings across tests/ — 13,392 → 0 (repo-wide scan clean)
Comment/XML-doc changes only: - add summaries to ~10k test methods, fixtures, fakes and helpers (+ <param> on theories, <returns> on async Task methods, <inheritdoc/> on interface implementations the checker can resolve) - strip ~2.6k project-tracking references (WP*, P*-*, row-NN, Task N, #NN, Component-0NN) from comments, keeping the explanatory text; reword false positives in comments only - real docs on fakes implementing BCL/library interfaces (IDisposable, ILogger, IOptionsMonitor, IAsyncLifetime) - reword the last 5 src/ false positives (CWE-1236, failures-1, year-0001, M365) Only non-comment edits: four one-line nested classes split across lines so members can carry docs. Build 0 errors / 0 warnings.
This commit is contained in:
@@ -32,6 +32,9 @@ public sealed class ApiKeyCrudTests : IClassFixture<ApiSurfaceFixture>
|
||||
private readonly PlaywrightFixture _fixture;
|
||||
private readonly ApiSurfaceFixture _api;
|
||||
|
||||
/// <summary>Creates the test class with the shared Playwright and API surface fixtures.</summary>
|
||||
/// <param name="fixture">The shared Playwright fixture.</param>
|
||||
/// <param name="api">The API surface fixture.</param>
|
||||
public ApiKeyCrudTests(PlaywrightFixture fixture, ApiSurfaceFixture api)
|
||||
{
|
||||
_fixture = fixture;
|
||||
@@ -44,6 +47,7 @@ public sealed class ApiKeyCrudTests : IClassFixture<ApiSurfaceFixture>
|
||||
/// adjacent "Copy" button. MUTATES — the created key is deleted via the CLI in a
|
||||
/// <c>finally</c> (resolve by name, best-effort delete) so nothing leaks.
|
||||
/// </summary>
|
||||
/// <returns>A task that represents the asynchronous operation.</returns>
|
||||
[SkippableFact]
|
||||
public async Task Create_RevealsOneTimeToken()
|
||||
{
|
||||
@@ -104,6 +108,7 @@ public sealed class ApiKeyCrudTests : IClassFixture<ApiSurfaceFixture>
|
||||
/// literal <c>"Name is required."</c> message in <c>div.text-danger</c>; no token panel
|
||||
/// appears, so nothing is created and there is no teardown.
|
||||
/// </summary>
|
||||
/// <returns>A task that represents the asynchronous operation.</returns>
|
||||
[SkippableFact]
|
||||
public async Task Create_EmptyName_ShowsValidationError()
|
||||
{
|
||||
@@ -136,6 +141,7 @@ public sealed class ApiKeyCrudTests : IClassFixture<ApiSurfaceFixture>
|
||||
/// <c>div.text-danger</c>; no token panel appears, so nothing is created and there is no
|
||||
/// teardown.
|
||||
/// </summary>
|
||||
/// <returns>A task that represents the asynchronous operation.</returns>
|
||||
[SkippableFact]
|
||||
public async Task Create_NoMethods_ShowsValidationError()
|
||||
{
|
||||
@@ -193,6 +199,7 @@ public sealed class ApiKeyCrudTests : IClassFixture<ApiSurfaceFixture>
|
||||
/// cell: it must appear after Disable and be gone after Enable. The CLI-created key is deleted
|
||||
/// in a <c>finally</c> (best-effort) so nothing leaks.
|
||||
/// </summary>
|
||||
/// <returns>A task that represents the asynchronous operation.</returns>
|
||||
[SkippableFact]
|
||||
public async Task ToggleEnabled_TransitionsDisabledBadge()
|
||||
{
|
||||
@@ -251,6 +258,7 @@ public sealed class ApiKeyCrudTests : IClassFixture<ApiSurfaceFixture>
|
||||
/// gone. The CLI delete in the <c>finally</c> is an idempotent safety net (no-op if the UI already
|
||||
/// removed it).
|
||||
/// </summary>
|
||||
/// <returns>A task that represents the asynchronous operation.</returns>
|
||||
[SkippableFact]
|
||||
public async Task Delete_WithConfirm_RemovesRow()
|
||||
{
|
||||
|
||||
@@ -9,10 +9,15 @@ namespace ZB.MOM.WW.ScadaBridge.CentralUI.PlaywrightTests.Admin;
|
||||
/// </summary>
|
||||
public sealed class ApiSurfaceFixture : IAsyncLifetime
|
||||
{
|
||||
/// <summary>The id of the provisioned inbound API method.</summary>
|
||||
public int MethodId { get; private set; }
|
||||
/// <summary>The unique name of the provisioned inbound API method.</summary>
|
||||
public string MethodName { get; private set; } = string.Empty;
|
||||
/// <summary>Whether the cluster was reachable and the method was provisioned.</summary>
|
||||
public bool Available { get; private set; }
|
||||
|
||||
/// <summary>Prepares the test class before the tests run.</summary>
|
||||
/// <returns>A task that represents the asynchronous operation.</returns>
|
||||
public async Task InitializeAsync()
|
||||
{
|
||||
Available = await ClusterAvailability.IsAvailableAsync();
|
||||
@@ -39,6 +44,8 @@ public sealed class ApiSurfaceFixture : IAsyncLifetime
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Releases the resources held by this test class asynchronously.</summary>
|
||||
/// <returns>A task that represents the asynchronous operation.</returns>
|
||||
public async Task DisposeAsync()
|
||||
{
|
||||
if (Available)
|
||||
|
||||
+10
-4
@@ -13,11 +13,15 @@ public class LdapMappingCrudTests
|
||||
{
|
||||
private readonly PlaywrightFixture _fixture;
|
||||
|
||||
/// <summary>Initializes the test class with the shared Playwright fixture.</summary>
|
||||
/// <param name="fixture">The shared Playwright fixture providing browser and cluster access.</param>
|
||||
public LdapMappingCrudTests(PlaywrightFixture fixture)
|
||||
{
|
||||
_fixture = fixture;
|
||||
}
|
||||
|
||||
/// <summary>Verifies that an LDAP group mapping can be created, edited and deleted through the UI.</summary>
|
||||
/// <returns>A task that represents the asynchronous operation.</returns>
|
||||
[SkippableFact]
|
||||
public async Task CreateEditDelete_LdapMapping_RoundTrips()
|
||||
{
|
||||
@@ -38,10 +42,10 @@ public class LdapMappingCrudTests
|
||||
// The LDAP Group Name label has no `for=` attribute so GetByLabel does not
|
||||
// work. Locate the input that immediately follows the label text instead.
|
||||
await page.Locator("label:has-text('LDAP Group Name') + input.form-control.form-control-sm").FillAsync(group);
|
||||
// Scope the role select to the div.mb-2 that owns the "Role" label so a
|
||||
// Scope the role select to the container div that owns the "Role" label so a
|
||||
// second select (Site Scope) on the edit page cannot cause a strict-mode
|
||||
// violation. The LdapMappingForm.razor uses Blazor @bind, not <form>,
|
||||
// so the "Role" label's parent div.mb-2 is the tightest stable scope.
|
||||
// so the "Role" label's parent container div is the tightest stable scope.
|
||||
await page.Locator("div.mb-2:has(label:has-text('Role')) .form-select.form-select-sm").SelectOptionAsync("Designer");
|
||||
await page.ClickAsync("button.btn.btn-success:has-text('Save')");
|
||||
|
||||
@@ -127,12 +131,13 @@ public class LdapMappingCrudTests
|
||||
/// <summary>
|
||||
/// The create form's <c>SaveMapping()</c> validates manually (no EditForm /
|
||||
/// DataAnnotations): a blank LDAP Group Name renders "LDAP Group Name is
|
||||
/// required." in <c>div.text-danger.small.mt-2</c> and returns early; a present
|
||||
/// required." in <c>div.text-danger.small</c> and returns early; a present
|
||||
/// group but blank role renders "Role is required." Both branches return before
|
||||
/// any persistence, so nothing is created and no teardown is needed. The first
|
||||
/// Save is a full circuit roundtrip — proving the Blazor circuit is live — which
|
||||
/// makes the second-leg fill (group → blank role) safe from the prerender race.
|
||||
/// </summary>
|
||||
/// <returns>A task that represents the asynchronous operation.</returns>
|
||||
[SkippableFact]
|
||||
public async Task Save_MissingGroupName_ShowsRequiredError()
|
||||
{
|
||||
@@ -176,10 +181,11 @@ public class LdapMappingCrudTests
|
||||
/// Attempting to create a mapping whose LDAP group already exists violates the DB
|
||||
/// unique index on <c>LdapGroupName</c>. The form has no friendly pre-check, so
|
||||
/// the persistence exception is caught and surfaced as "Save failed: {message}"
|
||||
/// in <c>div.text-danger.small.mt-2</c>, keeping the user on the create page.
|
||||
/// in <c>div.text-danger.small</c>, keeping the user on the create page.
|
||||
/// The duplicate is CLI-seeded (and torn down) so this asserts the save-failure
|
||||
/// branch without depending on the raw DB error text.
|
||||
/// </summary>
|
||||
/// <returns>A task that represents the asynchronous operation.</returns>
|
||||
[SkippableFact]
|
||||
public async Task Create_DuplicateGroup_ShowsSaveFailedError()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user