Skip to content

Commit ff5b881

Browse files
committed
test: 更新单元测试
1 parent 154dca4 commit ff5b881

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

test/UnitTest/Components/MultiSelectTest.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,18 @@ public void ButtonTemplate_Ok()
235235
pb.Add(a => a.ShowToolbar, true);
236236
pb.Add(a => a.ButtonTemplate, builder => builder.AddContent(0, new MarkupString("<button class=\"btn-test\">ButtonTemplate</button>")));
237237
});
238+
239+
// 没有数据不显示 Toolbar
240+
Assert.DoesNotContain("btn-test", cut.Markup);
241+
242+
cut.SetParametersAndRender(pb =>
243+
{
244+
pb.Add(a => a.Items, new List<SelectedItem>
245+
{
246+
new("1", "Test1"),
247+
new("2", "Test2")
248+
});
249+
});
238250
Assert.Contains("btn-test", cut.Markup);
239251
}
240252

0 commit comments

Comments
 (0)