Skip to content

Binding TelerikTextBox value in bUnit test #647

@Gambero81

Description

@Gambero81

I'm implementing an integration test with bUnit on a Blazor wasm component who use TelerikTextBox component.
I need to set the TelerikTextBox value as it can be binded to the associated component property:

Example:
razor:
<TelerikTextBox Id="txtUserName" @bind-Value="@UserName" />

cs:

public class Users: ComponentBase
{
   public string UserName {get;set;}
}

In the test method i can find and set the TelerikTextBox value with:

var txt = cut.FindComponents<TelerikTextBox>().FirstOrDefault(txt => txt.Instance.Id == "txtUserName")?.Instance;
txt.Value = "My TextBox Value";

but it not bind the property UserName of Users component.

How to reach my goal?

@EdCharbeneau

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions