| 1 | using AgentForge.Plugin.View; |
| 2 | |
| 3 | namespace AgentForge.Tests; |
| 4 | |
| 5 | public sealed class ForgeHtmlFormsTests |
| 6 | { |
| 7 | [Fact] |
| 8 | public void Form_renders_children_inside_form_not_in_role_attribute() |
| 9 | { |
| 10 | var html = ForgeHtml.Form( |
| 11 | "post", |
| 12 | "/view/example", |
| 13 | "field", |
| 14 | ForgeHtml.Label("name", "Pipeline name"), |
| 15 | ForgeHtml.Input(new ForgeInputSpec("name", Value: "default", Required: true)), |
| 16 | ForgeHtml.FieldSubmit(null, ForgeHtml.Button("submit", "Create"))); |
| 17 | |
| 18 | Assert.Contains("<form method=\"post\" action=\"/view/example\" class=\"field\">", html); |
| 19 | Assert.Contains("<label for=\"name\">Pipeline name</label>", html); |
| 20 | Assert.Contains("<input id=\"name\" name=\"name\"", html); |
| 21 | Assert.DoesNotContain("role=\"", html); |
| 22 | } |
| 23 | } |
| 24 | |
View only · write via MCP/CIDE