Skip to content

Commit 0c006ca

Browse files
committed
test: 增加单元测试
1 parent c4fd31d commit 0c006ca

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

test/UnitTest/Components/TabTest.cs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -655,6 +655,28 @@ public void ShowNavigatorButtons_Ok()
655655
Assert.Empty(links);
656656
}
657657

658+
[Fact]
659+
public void ShowActiveBar_Ok()
660+
{
661+
var cut = Context.RenderComponent<Tab>(pb =>
662+
{
663+
pb.Add(a => a.AdditionalAssemblies, new Assembly[] { GetType().Assembly });
664+
pb.Add(a => a.ShowActiveBar, true);
665+
pb.AddChildContent<TabItem>(pb =>
666+
{
667+
pb.Add(a => a.Text, "Tab1");
668+
pb.Add(a => a.Url, "/Cat");
669+
});
670+
});
671+
cut.Contains("<div class=\"tabs-active-bar\"></div>");
672+
673+
cut.SetParametersAndRender(pb =>
674+
{
675+
pb.Add(a => a.ShowActiveBar, false);
676+
});
677+
cut.DoesNotContain("<div class=\"tabs-active-bar\"></div>");
678+
}
679+
658680
[Fact]
659681
public void Text_Ok()
660682
{

0 commit comments

Comments
 (0)