Skip to content

Commit 8e15e6d

Browse files
committed
test: 增加单元测试
1 parent 18553b6 commit 8e15e6d

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

test/UnitTest/Components/UploadButtonTest.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public void ButtonUpload_IsDisabled_Ok()
8686
}
8787

8888
[Fact]
89-
public void InputUpload_IsMultiple()
89+
public async Task InputUpload_IsMultiple()
9090
{
9191
var cut = Context.RenderComponent<ButtonUpload<string>>(pb =>
9292
{
@@ -108,6 +108,13 @@ public void InputUpload_IsMultiple()
108108
var button = cut.Find(".btn-browser");
109109
Assert.True(button.IsDisabled());
110110

111+
// 调用 Reset 方法
112+
await cut.InvokeAsync(() => cut.Instance.Reset());
113+
114+
// 重置后上传按钮应该被启用
115+
button = cut.Find(".btn-browser");
116+
Assert.False(button.IsDisabled());
117+
111118
// 开启多选功能
112119
cut.SetParametersAndRender(pb =>
113120
{

0 commit comments

Comments
 (0)