<button @onclick="HandleClick">@title</button>
@code {
[Parameter]
public string title { get; set; } = "";
}
@code
{
[Fact]
public async Task HasTitle()
{
var Component = await mount(@<Button title="Hello" />);
await Expect(Component).ToHaveText("Hello");
}
}
or
public class Button
{
[Fact]
public void HasTitle()
{
var Component = mount<Button>({ props = { title = "hello" });
await Expect(Component).ToHaveText("Hello");
}
}
Motivation
I'm not a Blazor user, but i think it might be interesting for the people who do?
🚀 Feature Request
Wondering if you've considered adding Playwright component testing for Blazor: https://learn.microsoft.com/en-us/aspnet/core/blazor/test?view=aspnetcore-8.0#test-components-with-bunit?
Example
or
Motivation
I'm not a Blazor user, but i think it might be interesting for the people who do?