Skip to content

Commit 7627af1

Browse files
committed
test: 更新单元测试
1 parent 58c350f commit 7627af1

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

test/UnitTest/Components/SelectTest.cs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -760,6 +760,30 @@ public void ItemClick_Ok()
760760
});
761761
}
762762

763+
[Fact]
764+
public void DefaultVirtualizeItemText_Ok()
765+
{
766+
var cut = Context.RenderComponent<Select<string>>(pb =>
767+
{
768+
pb.Add(a => a.Items, new SelectedItem[]
769+
{
770+
new("1", "Test1"),
771+
new("2", "Test2")
772+
});
773+
pb.Add(a => a.Value, "3");
774+
pb.Add(a => a.IsVirtualize, true);
775+
});
776+
777+
var input = cut.Find(".form-select");
778+
Assert.Contains("value=\"3\"", input.OuterHtml);
779+
780+
cut.SetParametersAndRender(pb =>
781+
{
782+
pb.Add(a => a.DefaultVirtualizeItemText, "Test3");
783+
});
784+
Assert.Contains("value=\"Test3\"", input.OuterHtml);
785+
}
786+
763787
[Fact]
764788
public void IsVirtualize_Items()
765789
{

0 commit comments

Comments
 (0)