Skip to content

Commit 2fde567

Browse files
authored
test(BootstrapInputGroupLabel): add ChildContent unit test (#5910)
1 parent df71110 commit 2fde567

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

test/UnitTest/Components/InputTest.cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,22 @@ public void InputGroup_Width()
324324
cut.MarkupMatches("<div class=\"input-group\"><div class=\"input-group-text\" required=\"true\" style=\"--bb-input-group-label-width: 120px;\"><span>BootstrapInputGroup</span></div></div>");
325325
}
326326

327+
[Fact]
328+
public void InputGroup_ChildContent()
329+
{
330+
var cut = Context.RenderComponent<BootstrapInputGroup>(builder =>
331+
{
332+
builder.Add(s => s.ChildContent, new RenderFragment(builder =>
333+
{
334+
builder.OpenComponent<BootstrapInputGroupLabel>(0);
335+
builder.AddAttribute(1, nameof(BootstrapInputGroupLabel.ChildContent), new RenderFragment(builder => builder.AddContent(0, "child-content")));
336+
builder.CloseComponent();
337+
}));
338+
});
339+
340+
cut.Contains("child-content");
341+
}
342+
327343
[Theory]
328344
[InlineData(Alignment.Center, "center")]
329345
[InlineData(Alignment.Right, "end")]

0 commit comments

Comments
 (0)