mirror of
https://gitee.com/LongbowEnterprise/BootstrapBlazor.git
synced 2024-12-02 12:09:59 +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;
|
condtions = null;
|
||||||
cut.InvokeAsync(() => condtions = cut.FindComponent<StringFilter>().Instance.GetFilterConditions());
|
cut.InvokeAsync(() => condtions = cut.FindComponent<StringFilter>().Instance.GetFilterConditions());
|
||||||
Assert.Empty(condtions);
|
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]
|
[Fact]
|
||||||
public void CardUpload_Reset()
|
public async Task CardUpload_Reset()
|
||||||
{
|
{
|
||||||
var cut = Context.RenderComponent<CardUpload<string>>();
|
var cut = Context.RenderComponent<CardUpload<string>>();
|
||||||
cut.InvokeAsync(() => cut.Instance.Reset());
|
await cut.InvokeAsync(() => cut.Instance.Reset());
|
||||||
Assert.Null(cut.Instance.DefaultFileList);
|
Assert.Null(cut.Instance.DefaultFileList);
|
||||||
|
|
||||||
cut.SetParametersAndRender(pb =>
|
cut.SetParametersAndRender(pb =>
|
||||||
@ -607,7 +607,7 @@ public class UploadTest : BootstrapBlazorTestBase
|
|||||||
new UploadFile() { FileName = "Test-File1.text" }
|
new UploadFile() { FileName = "Test-File1.text" }
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
cut.InvokeAsync(() => cut.Instance.Reset());
|
await cut.InvokeAsync(() => cut.Instance.Reset());
|
||||||
Assert.Empty(cut.Instance.DefaultFileList);
|
Assert.Empty(cut.Instance.DefaultFileList);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user