fix(ui): schema-library delete-audit name + busy guard + edit-row guard + sanitized create-race test (#260)

This commit is contained in:
Joseph Doherty
2026-06-19 03:28:11 -04:00
parent e3b83f8561
commit 8f85cce298
5 changed files with 121 additions and 11 deletions
@@ -187,6 +187,26 @@ public class SchemaLibraryPageTests : BunitContext
9, "Address", Arg.Any<string?>(), Arg.Any<string>(), Arg.Any<CancellationToken>()));
}
[Fact]
public void Editing_DisablesRowActions_SoTheRowUnderEditCannotBeDeleted()
{
// #260: while the edit form is open the list still shows the row, but its
// Edit/Delete actions must be disabled so the row under edit (or a sibling)
// can't be deleted out from under the form.
SeedSchemas(new SharedSchema { Id = 9, Name = "Address", Scope = "us", SchemaJson = "{\"type\":\"object\"}" });
var cut = Render<SchemaLibraryPage>();
cut.WaitForState(() => cut.Markup.Contains("Address"));
cut.FindAll("tbody tr button").First(b => b.TextContent.Contains("Edit")).Click();
Assert.Contains("Edit Schema: Address", cut.Markup);
// Every row action button is now disabled while the editor is open.
var rowButtons = cut.FindAll("tbody tr button");
Assert.NotEmpty(rowButtons);
Assert.All(rowButtons, b => Assert.True(b.HasAttribute("disabled")));
}
/// <summary>A dialog service that auto-confirms, so the delete path runs end-to-end.</summary>
private sealed class AlwaysConfirmDialogService : IDialogService
{