refactor(adminui): trim inline-script label + null-case test + helper-proxy note
Code-review nits: trim the seed name so the in-session dropdown label matches the server-trimmed persisted name; add a null-selectedId test for ResolveScriptLabel; and note in CreateNewScriptAsync that the ordering invariant is proxied by the pure helper (AdminUI has no bUnit).
This commit is contained in:
@@ -59,6 +59,20 @@ public sealed class VirtualTagScriptDropdownTests
|
||||
label.ShouldBeNull();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ResolveScriptLabel_ReturnsNull_WhenSelectedIdIsNull()
|
||||
{
|
||||
// The helper parameter is string? — a null selection resolves to no label, not a throw.
|
||||
var options = new List<(string Id, string Display)>
|
||||
{
|
||||
("SC-existing001", "OldScript (CSharp)"),
|
||||
};
|
||||
|
||||
var label = VirtualTagModalHelpers.ResolveScriptLabel(options, null);
|
||||
|
||||
label.ShouldBeNull();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ResolveScriptLabel_ReturnsNull_WhenOptionsIsEmpty()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user