Skip to content

Commit

Permalink
test: 增加单元测试
Browse files Browse the repository at this point in the history
  • Loading branch information
ArgoZhang committed Oct 24, 2024
1 parent fa2f6e2 commit 92290c6
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions test/UnitTest/Components/InputTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -356,4 +356,21 @@ public void OnValueChanged_Ok()
Assert.Equal("Test_Test-Test_Test", val);
});
}

[Fact]
public async Task OnBlurAsync_Ok()
{
var blur = false;
var cut = Context.RenderComponent<BootstrapInput<string>>(builder =>
{
builder.Add(a => a.OnBlurAsync, v =>
{
blur = true;
return Task.CompletedTask;
});
});
var input = cut.Find("input");
await cut.InvokeAsync(() => { input.Blur(); });
Assert.True(blur);
}
}

0 comments on commit 92290c6

Please sign in to comment.