Mudblazor - Testing dialog content #588
-
I am looking to experiment with bUnit in my blazor project, but I am having trouble with the following: In my project I use MudBlazor components. In the component I am rendering I have all the content enclosed in tags. Everything inside these tags is NOT rendered and just translated into empty markup. If I put content outside the MudDialog-tags it is picked up as markup. So my question is now why the content of my dialog is not rendering in the unit test. I do not get any errors so there is no real indication of anything going wrong. It's just that the content is empty. I have tried taking all the content inside the MudDialog tags and placing it outside these tags. This does give me correctly rendered content in my test. However, this won't display correctly when actually using the application. I am not sure what I am doing wrong and I hope someone can give me a clue on how to proceed. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Hi Neal Im not a MudBlazor user myself, so I am just guessing here: I think it may be because the dialog is actually rendered by another component, perhaps one you add to the One that might be able to help is @Garderoben from the MudBlazor team. I know they have a pretty extensive bUnit test suite, so they probably know how to test a MudDialog. |
Beta Was this translation helpful? Give feedback.
Hi Neal
Im not a MudBlazor user myself, so I am just guessing here:
I think it may be because the dialog is actually rendered by another component, perhaps one you add to the
<App>
component in your app, and the MudDialog is just a component that capture what you want shown when you toggle it's "show me" property.One that might be able to help is @Garderoben from the MudBlazor team. I know they have a pretty extensive bUnit test suite, so they probably know how to test a MudDialog.