Skip to content

Commit 61f3619

Browse files
committed
test: 修复失败的单元测试
1 parent 4f5d3ce commit 61f3619

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

test/UnitTest/Components/AutoFillTest.cs

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -347,12 +347,7 @@ public async Task IsVirtualize_Items_Clearable_Ok()
347347
pb.Add(a => a.IsClearable, true);
348348
pb.Add(a => a.OnGetDisplayText, f => f?.Name);
349349
});
350-
await cut.InvokeAsync(() => cut.Instance.TriggerFilter("2"));
351-
352-
// 点击 Clear 按钮
353-
var button = cut.Find(".clear-icon");
354-
await cut.InvokeAsync(() => button.Click());
355-
cut.SetParametersAndRender();
350+
await cut.InvokeAsync(() => cut.Instance.TriggerFilter(""));
356351

357352
var input = cut.Find(".form-control");
358353
Assert.Null(input.NodeValue);
@@ -462,7 +457,6 @@ public void Clearable_Ok()
462457
cut.Contains("clear-icon");
463458
}
464459

465-
466460
[Fact]
467461
public async Task Validate_Ok()
468462
{
@@ -511,8 +505,8 @@ await cut.InvokeAsync(() =>
511505
Assert.Equal("Test-Select1", model.Value.Name);
512506

513507
// 点击 Clear 按钮
514-
var button = cut.Find(".clear-icon");
515-
await cut.InvokeAsync(() => button.Click());
508+
var autoFill = cut.FindComponent<AutoFill<Foo>>();
509+
await cut.InvokeAsync(() => autoFill.Instance.TriggerFilter(""));
516510

517511
var form = cut.Find("form");
518512
form.Submit();

0 commit comments

Comments
 (0)