Skip to content

Commit 41a861d

Browse files
committed
test: DialButton 增加模板
1 parent d3e4435 commit 41a861d

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

test/UnitTest/Components/DialButtonTest.cs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,24 @@ public void ItemTemplate_Ok()
222222
cut.Contains("test-fa-solid fa-cut-cut");
223223
}
224224

225+
[Fact]
226+
public void Item_ChildContent_Ok()
227+
{
228+
var cut = Context.RenderComponent<DialButton>(pb =>
229+
{
230+
pb.Add(i => i.ChildContent, new RenderFragment(pb =>
231+
{
232+
pb.OpenComponent<DialButtonItem>(0);
233+
pb.AddAttribute(1, "ChildContent", new RenderFragment(pb =>
234+
{
235+
pb.AddContent(0, "test-ChildContent");
236+
}));
237+
pb.CloseComponent();
238+
}));
239+
});
240+
cut.Contains("test-ChildContent");
241+
}
242+
225243
[Fact]
226244
public void DialButtonItem_Ok()
227245
{

0 commit comments

Comments
 (0)