Skip to content

Commit

Permalink
MudPopover: Fix DisposeAsync causing hang on MAUI (#5367), remove irr…
Browse files Browse the repository at this point in the history
…elevant test
  • Loading branch information
henon committed Apr 11, 2023
1 parent 6766cc5 commit 49e627a
Showing 1 changed file with 0 additions and 24 deletions.
24 changes: 0 additions & 24 deletions src/MudBlazor.UnitTests/Components/PopoverTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -657,30 +657,6 @@ public async Task MudPopoverService_DisposeAsync_WithTaskCancelException()
mock.Verify();
}

[Test]
public async Task MudPopoverService_DisposeAsync_ThrowsExceptionIfNotTaskCancelException()
{
var mock = new Mock<IJSRuntime>();

mock.Setup(x =>
x.InvokeAsync<IJSVoidResult>(
"mudPopover.initialize",
It.Is<object[]>(x => x.Length == 2 && (string)x[0] == "mudblazor-main-content" && (int)x[1] == 0))).ReturnsAsync(Mock.Of<IJSVoidResult>).Verifiable();

mock.Setup(x =>
x.InvokeAsync<IJSVoidResult>(
"mudPopover.dispose",
It.Is<object[]>(x => x.Length == 0))).ThrowsAsync(new InvalidOperationException()).Verifiable();

var service = new MudPopoverService(mock.Object);
await service.InitializeIfNeeded();

//any other exception (despite TaskCancelException, should result in an exception
Assert.ThrowsAsync<InvalidOperationException>(async () => await service.DisposeAsync());

mock.Verify();
}

[Test(Description = "Remove in v7")]
public void MudPopoverService_RegisterAndUseHandler()
{
Expand Down

0 comments on commit 49e627a

Please sign in to comment.