Skip to content

bUnit Integration Test of a Modal Dialog gets stuck in a deadlock #8961

Answered by mdausman-bi
mdausman-bi asked this question in Q&A
Discussion options

You must be logged in to vote

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.

    [Fact]
    public void RequirementUpdate_ProgressUpdates() // Change "async Task" to "void"
    {
        var component = RenderComponent<MudBlazorTestWrapper>(x  => 
            x.AddChildContent<ContractStatusDetails>(parameters =>
                parameters.Add(queryString => queryString.ContractDetailId, _contractDetailId.ToString()))
        );
	
        // Check the actions needed
        var progress = component.Find(".progress");
        progress.InnerHtml.Should().Contain("Action Needed (4)");
	
        // Click the button to open …

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
1 reply
@mdausman-bi
Comment options

Comment options

You must be logged in to vote
3 replies
@ScarletKuro
Comment options

@mdausman-bi
Comment options

@ScarletKuro
Comment options

Answer selected by mdausman-bi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants