Skip to content

Commit b3c3644

Browse files
committed
test: 更新单元测试
1 parent c4ae114 commit b3c3644

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

test/UnitTest/Components/SelectGenericTest.cs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,29 @@ namespace UnitTest.Components;
1313

1414
public class SelectGenericTest : BootstrapBlazorTestBase
1515
{
16+
17+
[Fact]
18+
public void ScrollIntoViewBehavior_Ok()
19+
{
20+
var cut = Context.RenderComponent<SelectGeneric<string>>(pb =>
21+
{
22+
pb.Add(a => a.Items, new List<SelectedItem<string>>()
23+
{
24+
new("1", "Test1"),
25+
new("2", "Test2")
26+
});
27+
pb.Add(a => a.Value, "2");
28+
pb.Add(a => a.ScrollIntoViewBehavior, ScrollIntoViewBehavior.Auto);
29+
});
30+
Assert.Contains("data-bb-scroll-behavior=\"auto\"", cut.Markup);
31+
32+
cut.SetParametersAndRender(pb =>
33+
{
34+
pb.Add(a => a.ScrollIntoViewBehavior, ScrollIntoViewBehavior.Smooth);
35+
});
36+
Assert.DoesNotContain("data-bb-scroll-behavior", cut.Markup);
37+
}
38+
1639
[Fact]
1740
public async Task OnSearchTextChanged_Null()
1841
{

0 commit comments

Comments
 (0)