Skip to content

Commit 22cc0ea

Browse files
ArgoZhangdensen2014h2ls
authored
test: add ItemsChanged unit test of Table (#357)
Co-authored-by: alex chow <zhouchuanglin@gmail.com> Co-authored-by: lambert lee <lish@live.cn>
1 parent 63c5b60 commit 22cc0ea

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

test/UnitTest/Components/TableDialogTest.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,10 +118,15 @@ public async Task EditAsync_Ok()
118118
await cut.InvokeAsync(() => form.Submit());
119119
await cut.InvokeAsync(() => modal.Instance.CloseCallback());
120120

121+
var itemsChanged = false;
121122
// 更新插入模式
122123
table.SetParametersAndRender(pb =>
123124
{
124125
pb.Add(a => a.InsertRowMode, InsertRowMode.First);
126+
pb.Add(a => a.ItemsChanged, foo =>
127+
{
128+
itemsChanged = true;
129+
});
125130
});
126131

127132
// Add 弹窗
@@ -134,6 +139,7 @@ public async Task EditAsync_Ok()
134139
form = cut.Find(".modal-body form");
135140
await cut.InvokeAsync(() => form.Submit());
136141
await cut.InvokeAsync(() => modal.Instance.CloseCallback());
142+
Assert.True(itemsChanged);
137143
}
138144

139145
private class MockEFCoreDataService : IDataService<Foo>, IEntityFrameworkCoreDataService

0 commit comments

Comments
 (0)