Skip to content

Commit 6d746e7

Browse files
committed
test: 增加单元测试
1 parent f92e281 commit 6d746e7

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

test/UnitTest/Components/SelectTest.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,18 @@ public void Disabled_Ok()
106106
Assert.Contains("dropdown-item active disabled", cut.Markup);
107107
}
108108

109+
[Fact]
110+
public void LookupService_Ok()
111+
{
112+
// 不给 Items 时走 LookupService
113+
var cut = Context.RenderComponent<Select<string>>(pb =>
114+
{
115+
pb.Add(a => a.LookupServiceKey, "FooLookup");
116+
});
117+
cut.WaitForAssertion(() => cut.Contains("LookupService-Test-1"));
118+
Assert.Equal(2, cut.Instance.Items.Count());
119+
}
120+
109121
[Fact]
110122
public void IsClearable_Ok()
111123
{

0 commit comments

Comments
 (0)