feat(central-ui): ParameterValueForm.ValidChanged — additive validity callback

Claude-Session: https://claude.ai/code/session_01NcMG6xXdsJbmD2wYAgkK29
This commit is contained in:
Joseph Doherty
2026-09-08 01:09:30 -04:00
parent fefa3ffa77
commit a36c813b89
2 changed files with 25 additions and 0 deletions
@@ -282,4 +282,19 @@ public class ParameterValueFormTests : BunitContext
Assert.Single(cut.FindAll("button.param-list-remove"));
Assert.NotEmpty(cut.FindAll(".text-danger"));
}
[Fact]
public void ValidChanged_ReportsFalseOnAParseError_AndTrueOnceFixed()
{
var valid = new List<bool>();
var cut = Render<ParameterValueForm>(p => p
.Add(x => x.ParameterDefinitions, """{"type":"object","properties":{"n":{"type":"integer"}}}""")
.Add(x => x.ValidChanged, v => valid.Add(v)));
var input = cut.Find("#param-n");
input.Input("abc");
Assert.False(valid.Last());
input.Input("5");
Assert.True(valid.Last());
}
}