Skip to content

Commit 73a94d1

Browse files
committed
test: 增加单元测试
1 parent cdd0fe5 commit 73a94d1

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

test/UnitTest/Components/TabTest.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1167,6 +1167,21 @@ public void TabHeader_Ok()
11671167
tab.DoesNotContain("tabs-header");
11681168
}
11691169

1170+
[Fact]
1171+
public void OnTabHeaderTextLocalizer_Ok()
1172+
{
1173+
var cut = Context.RenderComponent<Tab>(pb =>
1174+
{
1175+
pb.Add(a => a.AdditionalAssemblies, new Assembly[] { GetType().Assembly });
1176+
pb.Add(a => a.OnTabHeaderTextLocalizer, text =>
1177+
{
1178+
return $"Localized-{text}";
1179+
});
1180+
pb.Add(a => a.DefaultUrl, "/Cat");
1181+
});
1182+
cut.Contains("Localized-Cat");
1183+
}
1184+
11701185
class DisableTabItemButton : ComponentBase
11711186
{
11721187
[CascadingParameter, NotNull]

0 commit comments

Comments
 (0)