Unit testing BlazoredModal using BUnit #438
-
Hi. I am unable to replicate the BUnit DisplayTests (for example, ModalDisplaysSpecifiedTitle()). I would like to be able to use these unit tests as a basis for testing the behaviour of custom components rendered within the Blazored Modal. I am hoping to use the IModalReference returned from the ModalService Show methods to test the behaviour of custom components. When I render the BlazoredModal using the ModalService as a cascading value the rendered markup just consists of three line breaks. Then when the modal Show method is called there appears to be no elements and the BlazoredModalInstance is not found. Please could someone help with this as it would be really useful to be able to tests components rendered with the Blazored modal? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
In my test class I had omitted JSInterop.Mode = JSRuntimeMode.Loose; Once added, I was able to replicate the display tests |
Beta Was this translation helpful? Give feedback.
In my test class I had omitted JSInterop.Mode = JSRuntimeMode.Loose; Once added, I was able to replicate the display tests