Skip to content

Commit f078893

Browse files
committed
test: 增加单元测试
1 parent c68e238 commit f078893

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

test/UnitTest/Components/ToolbarTest.cs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,28 @@ public void Toolbar_Ok()
4141
// 检查 填充元素
4242
cut.Contains("bb-toolbar-space");
4343
}
44+
45+
[Fact]
46+
public void ToolbarButtonGroup_Ok()
47+
{
48+
var cut = Context.RenderComponent<ToolbarButtonGroup>(pb =>
49+
{
50+
pb.AddChildContent<Button>(pb2 =>
51+
{
52+
pb2.Add(a => a.Text, "Button1");
53+
});
54+
pb.AddChildContent<Button>(pb2 =>
55+
{
56+
pb2.Add(a => a.Text, "Button2");
57+
});
58+
});
59+
// 检查 ButtonGroup
60+
cut.Contains("bb-toolbar-group btn-group");
61+
62+
// 检查 Button1
63+
cut.Contains("Button1");
64+
65+
// 检查 Button2
66+
cut.Contains("Button2");
67+
}
4468
}

0 commit comments

Comments
 (0)