Merge branch 'worktree-agent-a5e1884475a5b785e' into feat/flow-debugger-script-entry

This commit is contained in:
Joseph Doherty
2026-09-08 01:16:11 -04:00
2 changed files with 66 additions and 0 deletions
@@ -297,4 +297,32 @@ public class ParameterValueFormTests : BunitContext
input.Input("5");
Assert.True(valid.Last());
}
[Fact]
public void ValidChanged_ReportsFalseOnFirstRender_WhenARequiredFieldIsEmpty()
{
var valid = new List<bool>();
var cut = Render<ParameterValueForm>(p => p
.Add(x => x.ParameterDefinitions, """{"type":"object","properties":{"n":{"type":"integer"}},"required":["n"]}""")
.Add(x => x.ValidChanged, v => valid.Add(v)));
// Reported without any input from the user...
Assert.False(valid.Last());
// ...and no red error text is painted for the untouched required field (the
// component has no "untouched" concept, so the validity check for
// ValidChanged deliberately does not populate _parseErrors on first render).
Assert.Empty(cut.FindAll(".text-danger"));
}
[Fact]
public void ValidChanged_ReportsTrueOnFirstRender_WhenNothingIsRequired()
{
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)));
Assert.True(valid.Last());
}
}