Skip to content

Commit 7201266

Browse files
committed
!3769 test(#I6AUXY): add unit test for table ShowTips
* test: 增加 ShowTips 单元测试
1 parent a968517 commit 7201266

1 file changed

Lines changed: 26 additions & 0 deletions

File tree

test/UnitTest/Components/TableTest.cs

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3603,6 +3603,32 @@ public void TableColumn_Editable()
36033603
Assert.True(column.Instance.Editable);
36043604
}
36053605

3606+
[Fact]
3607+
public void ShowTips_Ok()
3608+
{
3609+
var localizer = Context.Services.GetRequiredService<IStringLocalizer<Foo>>();
3610+
var items = Foo.GenerateFoo(localizer, 2);
3611+
var cut = Context.RenderComponent<BootstrapBlazorRoot>(pb =>
3612+
{
3613+
pb.AddChildContent<Table<Foo>>(pb =>
3614+
{
3615+
pb.Add(a => a.RenderMode, TableRenderMode.Table);
3616+
pb.Add(a => a.Items, items);
3617+
pb.Add(a => a.TableColumns, foo => builder =>
3618+
{
3619+
builder.OpenComponent<TableColumn<Foo, string>>(0);
3620+
builder.AddAttribute(1, "Field", "Name");
3621+
builder.AddAttribute(2, "FieldExpression", Utility.GenerateValueExpression(foo, "Name", typeof(string)));
3622+
builder.AddAttribute(3, "Editable", true);
3623+
builder.AddAttribute(7, "Text", "test");
3624+
builder.AddAttribute(9, "ShowTips", true);
3625+
builder.CloseComponent();
3626+
});
3627+
});
3628+
});
3629+
cut.Contains("data-bs-toggle=\"tooltip\"");
3630+
}
3631+
36063632
[Fact]
36073633
public void TableColumn_Property()
36083634
{

0 commit comments

Comments
 (0)