Skip to content

Commit 4c9f1aa

Browse files
committed
test: 增加 AllowExtensions 单元测试
1 parent 7ee88fb commit 4c9f1aa

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

test/UnitTest/Components/UploadCardTest.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,21 @@ public void CardUpload_ValidateForm_Ok()
145145
cut.Contains("form-label");
146146
}
147147

148+
[Fact]
149+
public void AllowExtensions_Ok()
150+
{
151+
var cut = Context.RenderComponent<CardUpload<string>>(pb =>
152+
{
153+
pb.Add(a => a.AllowExtensions, [".dba"]);
154+
pb.Add(a => a.DefaultFileList, new List<UploadFile>()
155+
{
156+
new() { FileName = "test.dba" }
157+
});
158+
});
159+
160+
cut.Contains("<span>test.dba</span> (0 B)");
161+
}
162+
148163
[Fact]
149164
public async Task CardUpload_ShowProgress_Ok()
150165
{

0 commit comments

Comments
 (0)