Skip to content

Commit 32650d6

Browse files
committed
test: 增加单元测试
1 parent b19ed0c commit 32650d6

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

test/UnitTest/Components/DropdownTest.cs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,25 @@ public async Task ShowSplit_OK()
3333
Assert.True(clickedWithoutRender);
3434
}
3535

36+
[Fact]
37+
public async Task IsAsync_Ok()
38+
{
39+
var cut = Context.RenderComponent<Dropdown<EnumEducation>>(pb =>
40+
{
41+
pb.Add(a => a.ShowSplit, true);
42+
pb.Add(a => a.IsAsync, true);
43+
pb.Add(a => a.IsKeepDisabled, false);
44+
pb.Add(a => a.Icon, "fa-solid fa-test-icon");
45+
pb.Add(a => a.OnClickWithoutRender, () =>
46+
{
47+
return Task.CompletedTask;
48+
});
49+
});
50+
cut.Contains("<i class=\"fa-solid fa-test-icon\"></i>");
51+
var button = cut.Find("button");
52+
await cut.InvokeAsync(() => button.Click());
53+
}
54+
3655
[Fact]
3756
public void ShowSize_OK()
3857
{

0 commit comments

Comments
 (0)