bUnit Integration Test of a Modal Dialog gets stuck in a deadlock #8961
-
I have a grid component on a razor page with a button that fires the ShowDialog method below to get user input. The MudBlazor Dialog "sits" on the DialogService.ShowAsync call until the user clicks OK or Cancels. The Refresh() method updates the razor page with updated data in other razor components on the same page. I am unable to figure out how to unit test this integration between components because the unit test code is waiting for the dialog to be closed and that never happens. Basically it's stuck in a deadlock.
Unit Test:
Just testing the dialog works fine and I can get the return value. However, for this test I need to validate that another component opens the dialog and when saved/applied a third razor component is updated. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
This could possibly fix your problem: #8964, but it's for v7, and it's not guaranteed that it will. Do you have the |
Beta Was this translation helpful? Give feedback.
-
I stumbled upon the solution... Make the test case synchronous and don't await the mouse call to open the dialog. The code below works as desired.
|
Beta Was this translation helpful? Give feedback.
I stumbled upon the solution... Make the test case synchronous and don't await the mouse call to open the dialog. The code below works as desired.