mirror of
https://gitee.com/LongbowEnterprise/BootstrapBlazor.git
synced 2024-11-30 02:58:37 +08:00
!2661 test(#I531V5): add ShowColumnList unit test on Table
* test: 增加 ShowColumnList 单元测试 * test: 更新 Upload 单元测试增加 await 关键字
This commit is contained in:
parent
5e582fc9c8
commit
e9a55c2b42
@ -200,6 +200,29 @@ public class TableTest : TableTestBase
|
||||
condtions = null;
|
||||
cut.InvokeAsync(() => condtions = cut.FindComponent<StringFilter>().Instance.GetFilterConditions());
|
||||
Assert.Empty(condtions);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ShowColumnList_Ok()
|
||||
{
|
||||
var localizer = Context.Services.GetRequiredService<IStringLocalizer<Foo>>();
|
||||
var cut = Context.RenderComponent<BootstrapBlazorRoot>(pb =>
|
||||
{
|
||||
pb.AddChildContent<Table<Foo>>(pb =>
|
||||
{
|
||||
pb.Add(a => a.ShowToolbar, true);
|
||||
pb.Add(a => a.ShowColumnList, true);
|
||||
pb.Add(a => a.ColumnButtonText, "Test_Column_List");
|
||||
pb.Add(a => a.Items, Foo.GenerateFoo(localizer));
|
||||
pb.Add(a => a.TableColumns, foo => builder =>
|
||||
{
|
||||
builder.OpenComponent<TableColumn<Foo, string>>(0);
|
||||
builder.AddAttribute(1, "Field", "Name");
|
||||
builder.AddAttribute(2, "FieldExpression", Utility.GenerateValueExpression(foo, "Name", typeof(string)));
|
||||
builder.CloseComponent();
|
||||
});
|
||||
});
|
||||
});
|
||||
cut.Contains("Test_Column_List");
|
||||
}
|
||||
}
|
||||
|
@ -594,10 +594,10 @@ public class UploadTest : BootstrapBlazorTestBase
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void CardUpload_Reset()
|
||||
public async Task CardUpload_Reset()
|
||||
{
|
||||
var cut = Context.RenderComponent<CardUpload<string>>();
|
||||
cut.InvokeAsync(() => cut.Instance.Reset());
|
||||
await cut.InvokeAsync(() => cut.Instance.Reset());
|
||||
Assert.Null(cut.Instance.DefaultFileList);
|
||||
|
||||
cut.SetParametersAndRender(pb =>
|
||||
@ -607,7 +607,7 @@ public class UploadTest : BootstrapBlazorTestBase
|
||||
new UploadFile() { FileName = "Test-File1.text" }
|
||||
});
|
||||
});
|
||||
cut.InvokeAsync(() => cut.Instance.Reset());
|
||||
await cut.InvokeAsync(() => cut.Instance.Reset());
|
||||
Assert.Empty(cut.Instance.DefaultFileList);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user