EditFormcomponent with a button as a child element the
EditFormget triggered by clicking on that button. But if I try to do a "Click" via bUnit it says there is no click handler registered, which makes sense. But not sure how to submit the form via bUnit's api?
var cut = Render(@<ManageUser ConfirmPasswordChange="DummyActions.AlwaysTrueFunc" OnPasswordUpdate="DummyActions.OnEvent"></ManageUser>); cut.Find("#new-password").Change("Test123!"); cut.Find("#new-password-confirm").Change("Test123!"); cut.Find("#old-password").Change("Admin123!");
OnInitializeAsync. I have switched the order of these find statements and whatever the order the first of the three calls is
nullin the rendered markup while the other have expected values.
MyCompoent.ImDoneNow, then you can also inspect that. E.g.
cut.WaitForState(() => cut.Instance.ImDoneNow);
WaitForElementsthat will make it a little less verbose.
cut.WaitForState(() => cut.FindAll("elementSelector").Count == 1)
TelerikRootComponentas suggested in another article I found. My guess is that the Authorize attribute does not hide the component because the parent component of the one I'm testing isn't related to routing. If not that, then something related to a service I'm missing, or both. My test case is just to confirm that certain components are not rendered when a user lacks roles. I can get an
AuthorizeViewto work, but not the entire component with the Authorize attribute.