Skip to content

Commit f574004

Browse files
committed
test: 更新单元测试
1 parent 22d153f commit f574004

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

test/UnitTest/Components/TableTest.cs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,9 @@ public async Task Items_EditForm_Add(InsertRowMode insertMode)
210210
var table = cut.FindComponent<Table<Foo>>();
211211
await cut.InvokeAsync(table.Instance.AddAsync);
212212
Assert.True(updated);
213-
Assert.Equal(2, table.Instance.Rows.Count);
213+
214+
var rows = table.FindAll("tbody tr");
215+
Assert.Equal(2, rows.Count);
214216
}
215217

216218
[Fact]
@@ -8929,8 +8931,11 @@ public async Task TestLoopQueryAsync()
89298931

89308932
public async Task TestDeleteAsync()
89318933
{
8932-
SelectedRows.Add(Rows[0]);
8933-
await DeleteAsync();
8934+
if (Items != null)
8935+
{
8936+
SelectedRows.Add(Items.First());
8937+
await DeleteAsync();
8938+
}
89348939
}
89358940

89368941
public string? TestGetCellClassString(ITableColumn col) => base.GetCellClassString(col, false, false);

0 commit comments

Comments
 (0)